Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ nodes:
- "METRICS"
resource:
action: "'CREATE'"
condition: "'service.namespace' in resource.attributes"
# OTel: service.namespace is optional; an unset or empty namespace is not a named namespace,
# so no namespace component is created for it: https://opentelemetry.io/docs/specs/semconv/registry/attributes/service/
condition: "'service.namespace' in resource.attributes && resource.attributes['service.namespace'] != ''"
vars:
- name: "namespace"
value: "resource.attributes['service.namespace']"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ nodes:
action: "'CREATE'"
condition: "'service.instance.id' in resource.attributes"
vars:
# OTel: service.namespace is optional and an unset namespace is itself a valid namespace, encoded here as the empty string.
# service.instance.id is unique only within its (service.namespace, service.name) pair: https://opentelemetry.io/docs/specs/semconv/registry/attributes/service/
- name: "namespace"
value: "resource.attributes['service.namespace']"
value: >-
'service.namespace' in resource.attributes ?
resource.attributes['service.namespace'] :
''
- name: "service"
value: "resource.attributes['service.name']"
- name: "version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ nodes:
action: "'CREATE'"
condition: "'service.name' in resource.attributes"
vars:
# OTel: service.namespace is optional and an unset namespace is itself a valid namespace, encoded here as the empty string.
# service.instance.id is unique only within its (service.namespace, service.name) pair: https://opentelemetry.io/docs/specs/semconv/registry/attributes/service/
- name: "namespace"
value: >-
resource.attributes['service.namespace'] != '' ?
'service.namespace' in resource.attributes ?
resource.attributes['service.namespace'] :
'default'
''
- name: "service"
value: "resource.attributes['service.name']"
- name: "version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ nodes:
metric:
# _seconds_ = telemetry gateway (target/new spanmetrics default); _milliseconds_ = standalone collector (current spanmetrics default, transitioning to s per OTel semantic conventions)
query: |-
(histogram_quantile(0.95, sum by(service_namespace, service_name, service_instance_id, le)(rate(otel_span_duration_seconds_bucket{span_kind=~"SPAN_KIND_SERVER|SPAN_KIND_CONSUMER"}[5m]))))
or
(histogram_quantile(0.95, sum by(service_namespace, service_name, service_instance_id, le)(rate(otel_span_duration_milliseconds_bucket{span_kind=~"SPAN_KIND_SERVER|SPAN_KIND_CONSUMER"}[5m]))) / 1000)
label_replace(
(histogram_quantile(0.95, sum by(service_namespace, service_name, service_instance_id, le)(rate(otel_span_duration_seconds_bucket{span_kind=~"SPAN_KIND_SERVER|SPAN_KIND_CONSUMER"}[5m]))))
or
(histogram_quantile(0.95, sum by(service_namespace, service_name, service_instance_id, le)(rate(otel_span_duration_milliseconds_bucket{span_kind=~"SPAN_KIND_SERVER|SPAN_KIND_CONSUMER"}[5m]))) / 1000)
, "service_urn_prefix", "urn:opentelemetry:namespace/$1:service/", "service_namespace", "(.*)")
aliasTemplate: Span duration 95th percentile
unit: s
threshold: 5
titleTemplate: Span duration
urnTemplate: "urn:opentelemetry:namespace/${service_namespace}:service/${service_name}:serviceInstance/${service_instance_id}"
# OTel: service.namespace is optional and an unset namespace is itself a valid namespace, encoded here as the empty string.
# service.instance.id is unique only within its (service.namespace, service.name) pair: https://opentelemetry.io/docs/specs/semconv/registry/attributes/service/
urnTemplate: "${service_urn_prefix}${service_name}:serviceInstance/${service_instance_id}"
description: |
Monitors the duration of the server and consumer spans. When the 95th percentile of the duration is greater than the threshold (default 5s) the monitor has a Deviating state.
function: urn:stackpack:common:monitor-function:threshold
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ nodes:
comparator: GT
failureState: DEVIATING
metric:
query: 'sum by(service_namespace, service_name, service_instance_id)(rate(otel_span_calls_total{status_code="STATUS_CODE_ERROR", span_kind=~"SPAN_KIND_SERVER|SPAN_KIND_CONSUMER"}[5m]) or (present_over_time(otel_span_calls_total{span_kind=~"SPAN_KIND_SERVER|SPAN_KIND_CONSUMER"}[5m]) -1)) / sum by(service_namespace, service_name, service_instance_id)(rate(otel_span_calls_total{span_kind=~"SPAN_KIND_SERVER|SPAN_KIND_CONSUMER"}[5m])) * 100'
query: |-
label_replace(
sum by(service_namespace, service_name, service_instance_id)(rate(otel_span_calls_total{status_code="STATUS_CODE_ERROR", span_kind=~"SPAN_KIND_SERVER|SPAN_KIND_CONSUMER"}[5m]) or (present_over_time(otel_span_calls_total{span_kind=~"SPAN_KIND_SERVER|SPAN_KIND_CONSUMER"}[5m]) -1)) / sum by(service_namespace, service_name, service_instance_id)(rate(otel_span_calls_total{span_kind=~"SPAN_KIND_SERVER|SPAN_KIND_CONSUMER"}[5m])) * 100
, "service_urn_prefix", "urn:opentelemetry:namespace/$1:service/", "service_namespace", "(.*)")
aliasTemplate: Error ratio (errors/total)
unit: percent
threshold: 5
titleTemplate: Span error ratio
urnTemplate: "urn:opentelemetry:namespace/${service_namespace}:service/${service_name}:serviceInstance/${service_instance_id}"
# OTel: service.namespace is optional and an unset namespace is itself a valid namespace, encoded here as the empty string.
# service.instance.id is unique only within its (service.namespace, service.name) pair: https://opentelemetry.io/docs/specs/semconv/registry/attributes/service/
urnTemplate: "${service_urn_prefix}${service_name}:serviceInstance/${service_instance_id}"
description: |
Percentage of server and consumer spans that are in an error state for the service instance.
function: urn:stackpack:common:monitor-function:threshold
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ nodes:
metric:
# _seconds_ = telemetry gateway (target/new spanmetrics default); _milliseconds_ = standalone collector (current spanmetrics default, transitioning to s per OTel semantic conventions)
query: |-
(histogram_quantile(0.95, sum by(service_namespace, service_name, le)(rate(otel_span_duration_seconds_bucket{span_kind=~"SPAN_KIND_SERVER|SPAN_KIND_CONSUMER"}[5m]))))
or
(histogram_quantile(0.95, sum by(service_namespace, service_name, le)(rate(otel_span_duration_milliseconds_bucket{span_kind=~"SPAN_KIND_SERVER|SPAN_KIND_CONSUMER"}[5m]))) / 1000)
label_replace(
(histogram_quantile(0.95, sum by(service_namespace, service_name, le)(rate(otel_span_duration_seconds_bucket{span_kind=~"SPAN_KIND_SERVER|SPAN_KIND_CONSUMER"}[5m]))))
or
(histogram_quantile(0.95, sum by(service_namespace, service_name, le)(rate(otel_span_duration_milliseconds_bucket{span_kind=~"SPAN_KIND_SERVER|SPAN_KIND_CONSUMER"}[5m]))) / 1000)
, "service_urn_prefix", "urn:opentelemetry:namespace/$1:service/", "service_namespace", "(.*)")
aliasTemplate: Span duration 95th percentile
unit: s
threshold: 5
titleTemplate: Span duration
urnTemplate: "urn:opentelemetry:namespace/${service_namespace}:service/${service_name}"
# OTel: service.namespace is optional and an unset namespace is itself a valid namespace, encoded here as the empty string.
# service.instance.id is unique only within its (service.namespace, service.name) pair: https://opentelemetry.io/docs/specs/semconv/registry/attributes/service/
urnTemplate: "${service_urn_prefix}${service_name}"
description: |
Monitors the duration of the server and consumer spans. When the 95th percentile of the duration is greater than the threshold (default 5s) the monitor has a Deviating state.
function: urn:stackpack:common:monitor-function:threshold
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ nodes:
comparator: GT
failureState: DEVIATING
metric:
query: 'sum by(service_namespace, service_name)(rate(otel_span_calls_total{status_code="STATUS_CODE_ERROR", span_kind=~"SPAN_KIND_SERVER|SPAN_KIND_CONSUMER"}[5m]) or (present_over_time(otel_span_calls_total{span_kind=~"SPAN_KIND_SERVER|SPAN_KIND_CONSUMER"}[5m]) -1)) / sum by(service_namespace, service_name)(rate(otel_span_calls_total{span_kind=~"SPAN_KIND_SERVER|SPAN_KIND_CONSUMER"}[5m])) * 100'
query: |-
label_replace(
sum by(service_namespace, service_name)(rate(otel_span_calls_total{status_code="STATUS_CODE_ERROR", span_kind=~"SPAN_KIND_SERVER|SPAN_KIND_CONSUMER"}[5m]) or (present_over_time(otel_span_calls_total{span_kind=~"SPAN_KIND_SERVER|SPAN_KIND_CONSUMER"}[5m]) -1)) / sum by(service_namespace, service_name)(rate(otel_span_calls_total{span_kind=~"SPAN_KIND_SERVER|SPAN_KIND_CONSUMER"}[5m])) * 100
, "service_urn_prefix", "urn:opentelemetry:namespace/$1:service/", "service_namespace", "(.*)")
aliasTemplate: Error ratio (errors/total)
unit: percent
threshold: 5
titleTemplate: Span error ratio
urnTemplate: "urn:opentelemetry:namespace/${service_namespace}:service/${service_name}"
# OTel: service.namespace is optional and an unset namespace is itself a valid namespace, encoded here as the empty string.
# service.instance.id is unique only within its (service.namespace, service.name) pair: https://opentelemetry.io/docs/specs/semconv/registry/attributes/service/
urnTemplate: "${service_urn_prefix}${service_name}"
description: |
Percentage of server and consumer spans that are in an error state for the service.
function: urn:stackpack:common:monitor-function:threshold
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ nodes:
condition: >-
'client' in datapoint.attributes &&
'server' in datapoint.attributes &&
'client_service.namespace' in datapoint.attributes &&
'server_service.namespace' in datapoint.attributes &&
'connection_type' in datapoint.attributes &&
datapoint.attributes['connection_type'] == 'messaging_system' &&
'client_peer.service' in datapoint.attributes
vars:
# OTel: service.namespace is optional and an unset namespace is itself a valid namespace, encoded here as the empty string.
# service.instance.id is unique only within its (service.namespace, service.name) pair: https://opentelemetry.io/docs/specs/semconv/registry/attributes/service/
- name: "sourceId"
value: >-
'server_service.instance.id' in datapoint.attributes ?
"urn:opentelemetry:namespace/" + datapoint.attributes['server_service.namespace'] + ":service/" + datapoint.attributes['server'] + ":serviceInstance/" + datapoint.attributes['server_service.instance.id'] :
"urn:opentelemetry:namespace/" + datapoint.attributes['server_service.namespace'] + ":service/" + datapoint.attributes['server'] + ":serviceInstance/" + datapoint.attributes['server']
"urn:opentelemetry:namespace/" + ('server_service.namespace' in datapoint.attributes ? datapoint.attributes['server_service.namespace'] : '') + ":service/" + datapoint.attributes['server'] + ":serviceInstance/" + datapoint.attributes['server_service.instance.id'] :
"urn:opentelemetry:namespace/" + ('server_service.namespace' in datapoint.attributes ? datapoint.attributes['server_service.namespace'] : '') + ":service/" + datapoint.attributes['server'] + ":serviceInstance/" + datapoint.attributes['server']
- name: "targetId"
value: >-
'urn:opentelemetry:namespace/' + datapoint.attributes['client_service.namespace'] + ':service/' + datapoint.attributes['client_peer.service']
'urn:opentelemetry:namespace/' + ('client_service.namespace' in datapoint.attributes ? datapoint.attributes['client_service.namespace'] : '') + ':service/' + datapoint.attributes['client_peer.service']
output:
sourceId: "vars.sourceId"
targetId: "vars.targetId"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ nodes:
condition: >-
'client' in datapoint.attributes &&
'server' in datapoint.attributes &&
'client_service.namespace' in datapoint.attributes &&
'server_service.namespace' in datapoint.attributes &&
'connection_type' in datapoint.attributes &&
datapoint.attributes['connection_type'] == 'messaging_system' &&
!('client_peer.service' in datapoint.attributes)
vars:
# OTel: service.namespace is optional and an unset namespace is itself a valid namespace, encoded here as the empty string.
# service.instance.id is unique only within its (service.namespace, service.name) pair: https://opentelemetry.io/docs/specs/semconv/registry/attributes/service/
- name: "sourceId"
value: >-
'client_service.instance.id' in datapoint.attributes ?
"urn:opentelemetry:namespace/" + datapoint.attributes['client_service.namespace'] + ":service/" + datapoint.attributes['client'] + ":serviceInstance/" + datapoint.attributes['client_service.instance.id'] :
"urn:opentelemetry:namespace/" + datapoint.attributes['client_service.namespace'] + ":service/" + datapoint.attributes['client'] + ":serviceInstance/" + datapoint.attributes['client']
"urn:opentelemetry:namespace/" + ('client_service.namespace' in datapoint.attributes ? datapoint.attributes['client_service.namespace'] : '') + ":service/" + datapoint.attributes['client'] + ":serviceInstance/" + datapoint.attributes['client_service.instance.id'] :
"urn:opentelemetry:namespace/" + ('client_service.namespace' in datapoint.attributes ? datapoint.attributes['client_service.namespace'] : '') + ":service/" + datapoint.attributes['client'] + ":serviceInstance/" + datapoint.attributes['client']
- name: "targetId"
value: >-
'server_service.instance.id' in datapoint.attributes ?
"urn:opentelemetry:namespace/" + datapoint.attributes['server_service.namespace'] + ":service/" + datapoint.attributes['server'] + ":serviceInstance/" + datapoint.attributes['server_service.instance.id'] :
"urn:opentelemetry:namespace/" + datapoint.attributes['server_service.namespace'] + ":service/" + datapoint.attributes['server'] + ":serviceInstance/" + datapoint.attributes['server']
"urn:opentelemetry:namespace/" + ('server_service.namespace' in datapoint.attributes ? datapoint.attributes['server_service.namespace'] : '') + ":service/" + datapoint.attributes['server'] + ":serviceInstance/" + datapoint.attributes['server_service.instance.id'] :
"urn:opentelemetry:namespace/" + ('server_service.namespace' in datapoint.attributes ? datapoint.attributes['server_service.namespace'] : '') + ":service/" + datapoint.attributes['server'] + ":serviceInstance/" + datapoint.attributes['server']
output:
sourceId: "vars.sourceId"
targetId: "vars.targetId"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@ nodes:
condition: >-
'client' in datapoint.attributes &&
'server' in datapoint.attributes &&
'client_service.namespace' in datapoint.attributes &&
'connection_type' in datapoint.attributes &&
datapoint.attributes['connection_type'] == 'messaging_system' &&
'client_peer.service' in datapoint.attributes
vars:
# OTel: service.namespace is optional and an unset namespace is itself a valid namespace, encoded here as the empty string.
# service.instance.id is unique only within its (service.namespace, service.name) pair: https://opentelemetry.io/docs/specs/semconv/registry/attributes/service/
- name: "sourceId"
value: >-
'client_service.instance.id' in datapoint.attributes ?
"urn:opentelemetry:namespace/" + datapoint.attributes['client_service.namespace'] + ":service/" + datapoint.attributes['client'] + ":serviceInstance/" + datapoint.attributes['client_service.instance.id'] :
"urn:opentelemetry:namespace/" + datapoint.attributes['client_service.namespace'] + ":service/" + datapoint.attributes['client'] + ":serviceInstance/" + datapoint.attributes['client']
"urn:opentelemetry:namespace/" + ('client_service.namespace' in datapoint.attributes ? datapoint.attributes['client_service.namespace'] : '') + ":service/" + datapoint.attributes['client'] + ":serviceInstance/" + datapoint.attributes['client_service.instance.id'] :
"urn:opentelemetry:namespace/" + ('client_service.namespace' in datapoint.attributes ? datapoint.attributes['client_service.namespace'] : '') + ":service/" + datapoint.attributes['client'] + ":serviceInstance/" + datapoint.attributes['client']
- name: "targetId"
value: >-
'urn:opentelemetry:namespace/' + datapoint.attributes['client_service.namespace'] + ':service/' + datapoint.attributes['client_peer.service']
'urn:opentelemetry:namespace/' + ('client_service.namespace' in datapoint.attributes ? datapoint.attributes['client_service.namespace'] : '') + ':service/' + datapoint.attributes['client_peer.service']
output:
sourceId: "vars.sourceId"
targetId: "vars.targetId"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ nodes:
vars:
- name: "awsEcsTaskId"
value: "resource.attributes['aws.ecs.task.id']"
# OTel: service.namespace is optional and an unset namespace is itself a valid namespace, encoded here as the empty string.
# service.instance.id is unique only within its (service.namespace, service.name) pair: https://opentelemetry.io/docs/specs/semconv/registry/attributes/service/
- name: "namespace"
value: >-
'service.namespace' in resource.attributes &&
resource.attributes['service.namespace'] != '' ?
'service.namespace' in resource.attributes ?
resource.attributes['service.namespace'] :
'default'
''
- name: "service"
value: "resource.attributes['service.name']"
- name: "instanceId"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ nodes:
vars:
- name: "faasId"
value: "resource.attributes['faas.id']"
# OTel: service.namespace is optional and an unset namespace is itself a valid namespace, encoded here as the empty string.
# service.instance.id is unique only within its (service.namespace, service.name) pair: https://opentelemetry.io/docs/specs/semconv/registry/attributes/service/
- name: "namespace"
value: >-
'service.namespace' in resource.attributes &&
resource.attributes['service.namespace'] != '' ?
'service.namespace' in resource.attributes ?
resource.attributes['service.namespace'] :
'default'
''
- name: "service"
value: "resource.attributes['service.name']"
- name: "instanceId"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ nodes:
vars:
- name: "hostId"
value: "resource.attributes['host.id']"
# OTel: service.namespace is optional and an unset namespace is itself a valid namespace, encoded here as the empty string.
# service.instance.id is unique only within its (service.namespace, service.name) pair: https://opentelemetry.io/docs/specs/semconv/registry/attributes/service/
- name: "namespace"
value: >-
'service.namespace' in resource.attributes &&
resource.attributes['service.namespace'] != '' ?
'service.namespace' in resource.attributes ?
resource.attributes['service.namespace'] :
'default'
''
- name: "service"
value: "resource.attributes['service.name']"
- name: "instanceId"
Expand Down
Loading
Loading