Skip to content

Conversation

bjrara
Copy link
Member

@bjrara bjrara commented Aug 29, 2024

Feature request

Add runtime metrics collection into Application Signals. Runtime metrics will be enabled by default if OTEL_AWS_APPLICATION_SIGNALS_ENABLED is true, and can be disabled separately by setting OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED to false.

Description of changes:

  1. Add ScopeBasedPeriodicExportingMetricReader to copy metrics from opentelemetry.instrumentation.system_metrics instrumentation scope to Application Signals exporter.
  2. Set aws.local.service into resource attributes.
  3. Add views to workaround Multiple system metrics return negative values when using DELTA temporality. open-telemetry/opentelemetry-python-contrib#2861.
  4. Add contract testing for runtime metrics.

Result example

{
  "resource_metrics": [
    {
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.25.0",
          "service.name": "unknown_service",
          "cloud.provider": "aws",
          "cloud.platform": "aws_ec2",
          "cloud.account.id": "633750930120",
          "cloud.region": "us-east-1",
          "cloud.availability_zone": "us-east-1a",
          "host.id": "i-03ff80a878a803e0e",
          "host.type": "t2.medium",
          "host.name": "ip-172-31-25-215.ec2.internal",
          "telemetry.auto.version": "0.3.0.dev0-aws",
          "aws.local.service": "UnknownService"
        },
        "schema_url": ""
      },
      "scope_metrics": [
        {
          "scope": {
            "name": "opentelemetry.instrumentation.system_metrics",
            "version": "0.46b0",
            "schema_url": "https://opentelemetry.io/schemas/1.11.0"
          },
          "metrics": [
            {
              "name": "process.runtime.cpython.memory",
              "description": "Runtime cpython memory",
              "unit": "bytes",
              "data": {
                "data_points": [
                  {
                    "attributes": {
                      "type": "rss"
                    },
                    "start_time_unix_nano": 1724953385390606423,
                    "time_unix_nano": 1724953385391126083,
                    "value": 75747328
                  },
                  {
                    "attributes": {
                      "type": "vms"
                    },
                    "start_time_unix_nano": 1724953385390606423,
                    "time_unix_nano": 1724953385391126083,
                    "value": 546709504
                  }
                ],
                "aggregation_temporality": 2,
                "is_monotonic": false
              }
            }
          ]
        }
      ]
    }
  ]
}

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@bjrara bjrara requested a review from a team as a code owner August 29, 2024 18:29
@bjrara bjrara force-pushed the runtime branch 10 times, most recently from e9f772c to f6818f9 Compare August 31, 2024 02:18
@bjrara bjrara force-pushed the runtime branch 3 times, most recently from 26119ef to 424e44c Compare September 12, 2024 04:51
@bjrara bjrara force-pushed the runtime branch 10 times, most recently from 62a86e1 to ec71a68 Compare September 19, 2024 00:27
mxiamxia
mxiamxia previously approved these changes Sep 23, 2024
vastin
vastin previously approved these changes Sep 26, 2024
@bjrara bjrara dismissed stale reviews from vastin and mxiamxia via a7ea746 September 27, 2024 17:14
@bjrara bjrara force-pushed the runtime branch 6 times, most recently from 1f9541d to 278f6e2 Compare October 4, 2024 06:09
@bjrara bjrara force-pushed the runtime branch 8 times, most recently from 3c51adc to 9b6ca07 Compare October 7, 2024 23:58
@bjrara bjrara changed the title [DO NOT MERGE] Add Application Signals runtime metrics Add Application Signals runtime metrics Oct 24, 2024
@bjrara bjrara merged commit 7bf7202 into aws-observability:main Oct 25, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants