Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[doc] Document server-generated metrics #5084

Closed
axw opened this issue Apr 13, 2021 · 1 comment · Fixed by #6173
Closed

[doc] Document server-generated metrics #5084

axw opened this issue Apr 13, 2021 · 1 comment · Fixed by #6173
Assignees
Milestone

Comments

@axw
Copy link
Member

axw commented Apr 13, 2021

Ideally we would have a complete specification for valid documents (#4410). Until we get there, we should at least make sure the Elasticsearch docs we produce are documented -- possibly as part of user-facing elastic.co docs, possibly just as developer-focused docs in the git repo.

For example, these docs should describe the fields present in:

  • "transaction" metrics (
    func makeMetricset(key transactionAggregationKey, hash uint64, ts time.Time, counts []int64, values []float64) model.Metricset {
    out := model.Metricset{
    Timestamp: ts,
    Name: metricsetName,
    Metadata: model.Metadata{
    Service: model.Service{
    Name: key.serviceName,
    Version: key.serviceVersion,
    Environment: key.serviceEnvironment,
    Agent: model.Agent{Name: key.agentName},
    },
    System: model.System{
    DetectedHostname: key.hostname,
    Container: model.Container{ID: key.containerID},
    Kubernetes: model.Kubernetes{PodName: key.kubernetesPodName},
    },
    },
    Event: model.MetricsetEventCategorization{
    Outcome: key.transactionOutcome,
    },
    Transaction: model.MetricsetTransaction{
    Name: key.transactionName,
    Type: key.transactionType,
    Result: key.transactionResult,
    Root: key.traceRoot,
    },
    Samples: []model.Sample{{
    Name: "transaction.duration.histogram",
    Counts: counts,
    Values: values,
    }},
    }
    // Record an timeseries instance ID, which should be uniquely identify the aggregation key.
    var timeseriesInstanceID strings.Builder
    timeseriesInstanceID.WriteString(key.serviceName)
    timeseriesInstanceID.WriteRune(':')
    timeseriesInstanceID.WriteString(key.transactionName)
    timeseriesInstanceID.WriteRune(':')
    timeseriesInstanceID.WriteString(fmt.Sprintf("%x", hash))
    out.TimeseriesInstanceID = timeseriesInstanceID.String()
    return out
    }
    )
  • "service_destination" metrics (
    func makeMetricset(timestamp time.Time, key aggregationKey, metrics spanMetrics, interval int64) model.Metricset {
    out := model.Metricset{
    Timestamp: timestamp,
    Name: metricsetName,
    Metadata: model.Metadata{
    Service: model.Service{
    Name: key.serviceName,
    Environment: key.serviceEnvironment,
    Agent: model.Agent{Name: key.agentName},
    },
    },
    Event: model.MetricsetEventCategorization{
    Outcome: key.outcome,
    },
    Span: model.MetricsetSpan{
    DestinationService: model.DestinationService{Resource: key.resource},
    },
    Samples: []model.Sample{
    {
    Name: "span.destination.service.response_time.count",
    Value: math.Round(metrics.count),
    },
    {
    Name: "span.destination.service.response_time.sum.us",
    Value: math.Round(metrics.sum),
    },
    },
    }
    if interval > 0 {
    // Only set metricset.period for a positive interval.
    //
    // An interval of zero means the metricset is computed
    // from an instantaneous value, meaning there is no
    // aggregation period.
    out.Samples = append(out.Samples, model.Sample{
    Name: "metricset.period",
    Value: float64(interval),
    })
    }
    return out
    }
    )
@axw axw added the docs label Apr 13, 2021
@axw
Copy link
Member Author

axw commented Apr 13, 2021

@sqren FYI

@zube zube bot added this to the 7.15 milestone Jul 1, 2021
@axw axw added v7.16.0 and removed v7.15.0 labels Aug 4, 2021
@axw axw modified the milestones: 7.15, 7.16 Aug 4, 2021
@zube zube bot changed the title Document server-generated metrics [doc] Document server-generated metrics Aug 20, 2021
@axw axw self-assigned this Sep 13, 2021
@axw axw closed this as completed in #6173 Sep 16, 2021
@zube zube bot removed the [zube]: Done label Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants