# Lab 6 bonus: count failed requests rather than spans in error.
# Stack on top of the lab 6 values: Helm merges maps, so the metric below is
# added to app.spans.errors instead of replacing it. Nothing else to restate,
# neither the pipelines nor deltatocumulative.
#   helm upgrade otel-demo open-telemetry/opentelemetry-demo --version 0.40.9 -n otel-demo \
#     -f manifests/values-training.yaml \
#     -f content/1_Labs/30-otel-collector-values.yaml \
#     -f content/1_Labs/60-otel-metrics-values.yaml \
#     -f content/1_Labs/61-otel-metrics-values.yaml
opentelemetry-collector:
  config:
    connectors:
      count:
        spans:
          app.requests.errors:
            description: "Number of failed server requests"
            conditions:
              # A failing request leaves several spans in error in the same
              # service; only one of them is the server span.
              - status.code == STATUS_CODE_ERROR and kind == SPAN_KIND_SERVER
