hypertrace / hypertrace-collector

OpenTelemetry collector distribution for Hypertrace platform
6 stars 5 forks source link

feat: criteria based span counter #99

Closed tim-mwangi closed 1 year ago

tim-mwangi commented 1 year ago

Description

Adds a processor that creates a metric for spans count based on matching certain conditions. The purpose is to be able to debug whether spans that match a certain criteria make it to the platform and how many of them make it. Here's an example of the processor config:

hypertrace_spancounter:
  tenant_configs:
    - tenant_id: foo-bar-baz
      service_configs:
        - service_name: test-service
          span_configs:
            - label: test-service-attr-rules-spans
              span_attributes:
                - key: rpc.service
                  value: config.service.v1,ConfigService
                - key: rpc.method
                  value: GetAttributeRules

When the collector receives spans that match the tenant, service and span attributes above, it will add the count of those spans to the otelcol_criteria_span_count metric.

Testing

Local testing and unit testing.

Checklist: