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

[APM][OTel] Make agent names generic with otel-native mode #195594

Conversation

miloszmarcinkowski
Copy link
Contributor

@miloszmarcinkowski miloszmarcinkowski commented Oct 9, 2024

Closes #195583

Summary

In the effort of making APM UI work with otel-native mode we introduced possibility for having any kind of agent names matching the following format: opentelemetry/* or otlp/*.

This change forced us to modify the way we collect data in 'services' and 'agents' tasks in apm telemetry.

Before the change, we could group data by agent names that were known ahead of time.

Right now, for opentelemetry agents, we have to group them by unique values. To achieve the following, we decided to run two ES queries:

  1. Collects data by the known list of non-opentelemetry agents names (the same approach as before but without opentelemetry agent names)
  2. (New) Collects data starting from opentelemetry/* or otlp/* and group them by unique value

To achieve backward compatibility, we initialize previously known opentelemetry/* or otlp/* agent names with empty values before collecting data. This way the new collectors match the old format, adding only unique opentelemetry agent names.

How to test

  1. Change schedule interval to 1m (default 720m) in x-pack/plugins/observability_solution/apm/server/lib/apm_telemetry/index.ts
  2. Run kibana server in debug mode (yarn debug-break) and place breakpoints in 'services' and 'agents' in x-pack/plugins/observability_solution/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.ts
  3. Verify tasks outputs:
`Services` task old output:
{
  "dotnet": 6,
  "go": 22,
  "iOS/swift": 1,
  "java": 11,
  "js-base": 0,
  "nodejs": 12,
  "php": 1,
  "python": 2,
  "ruby": 2,
  "rum-js": 3,
  "android/java": 1,
  "ios/swift": 0,
  "otlp": 0,
  "opentelemetry": 0,
  "opentelemetry/cpp": 0,
  "opentelemetry/dotnet": 1,
  "opentelemetry/erlang": 1,
  "opentelemetry/go": 2,
  "opentelemetry/java": 4,
  "opentelemetry/nodejs": 2,
  "opentelemetry/php": 0,
  "opentelemetry/python": 1,
  "opentelemetry/ruby": 0,
  "opentelemetry/rust": 0,
  "opentelemetry/swift": 0,
  "opentelemetry/android": 0,
  "opentelemetry/webjs": 0,
  "otlp/cpp": 0,
  "otlp/dotnet": 0,
  "otlp/erlang": 0,
  "otlp/go": 0,
  "otlp/java": 0,
  "otlp/nodejs": 0,
  "otlp/php": 0,
  "otlp/python": 0,
  "otlp/ruby": 0,
  "otlp/rust": 0,
  "otlp/swift": 0,
  "otlp/android": 0,
  "otlp/webjs": 0
}
`Services` task new output:
{
  "dotnet": 6,
  "go": 22,
  "iOS/swift": 1,
  "java": 11,
  "js-base": 0,
  "nodejs": 12,
  "php": 1,
  "python": 2,
  "ruby": 2,
  "rum-js": 3,
  "android/java": 1,
  "otlp": 0,
  "opentelemetry": 0,
  "opentelemetry/cpp": 0,
  "opentelemetry/dotnet": 1,
  "opentelemetry/erlang": 1,
  "opentelemetry/go": 2,
  "opentelemetry/java": 4,
  "opentelemetry/nodejs": 2,
  "opentelemetry/php": 0,
  "opentelemetry/python": 1,
  "opentelemetry/ruby": 0,
  "opentelemetry/rust": 0,
  "opentelemetry/swift": 0,
  "opentelemetry/android": 0,
  "opentelemetry/webjs": 0,
  "otlp/cpp": 0,
  "otlp/dotnet": 0,
  "otlp/erlang": 0,
  "otlp/go": 0,
  "otlp/java": 0,
  "otlp/nodejs": 0,
  "otlp/php": 0,
  "otlp/python": 0,
  "otlp/ruby": 0,
  "otlp/rust": 0,
  "otlp/swift": 0,
  "otlp/android": 0,
  "otlp/webjs": 0,
  "ios/swift": 0
}
`Agents` task old output:
{
  "dotnet": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.19.0+f72bf10e024b0bad4601ccda7fdea7db46c71640"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "ASP.NET Core"
        ],
        "version": [
          "3.1.7.0"
        ],
        "composite": [
          "ASP.NET Core/3.1.7.0"
        ]
      },
      "language": {
        "name": [
          "C#"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "AWS_lambda",
          ".NET Core"
        ],
        "version": [
          "3.1.7"
        ],
        "composite": [
          ".NET Core/3.1.7"
        ]
      }
    }
  },
  "go": {
    "agent": {
      "activation_method": [],
      "version": [
        "2.6.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "gin"
        ],
        "version": [
          "v1.10.0"
        ],
        "composite": [
          "gin/v1.10.0"
        ]
      },
      "language": {
        "name": [
          "go"
        ],
        "version": [
          "go1.22.7",
          "go1.18.3"
        ],
        "composite": [
          "go/go1.22.7",
          "go/go1.18.3"
        ]
      },
      "runtime": {
        "name": [
          "gc"
        ],
        "version": [
          "go1.22.7",
          "go1.18.3"
        ],
        "composite": [
          "gc/go1.22.7",
          "gc/go1.18.3"
        ]
      }
    }
  },
  "iOS/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [
          "iOS"
        ],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "java"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "iOS"
        ],
        "version": [
          "13",
          "9",
          "11"
        ],
        "composite": [
          "iOS/13",
          "iOS/9",
          "iOS/11"
        ]
      }
    }
  },
  "java": {
    "agent": {
      "activation_method": [
        "k8s-attach"
      ],
      "version": [
        "1.38.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "Spring Web MVC",
          "Servlet API"
        ],
        "version": [
          "6.1.11"
        ],
        "composite": [
          "Spring Web MVC/6.1.11"
        ]
      },
      "language": {
        "name": [
          "Java"
        ],
        "version": [
          "17.0.12"
        ],
        "composite": [
          "Java/17.0.12"
        ]
      },
      "runtime": {
        "name": [
          "Java"
        ],
        "version": [
          "17.0.12"
        ],
        "composite": [
          "Java/17.0.12"
        ]
      }
    }
  },
  "js-base": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "nodejs": {
    "agent": {
      "activation_method": [
        "env-attach",
        "require"
      ],
      "version": [
        "3.46.0",
        "4.7.2"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "express"
        ],
        "version": [
          "4.19.2",
          "4.18.2"
        ],
        "composite": [
          "express/4.19.2",
          "express/4.18.2"
        ]
      },
      "language": {
        "name": [
          "javascript"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "AWS_lambda",
          "node"
        ],
        "version": [
          "18.13.0",
          "22.5.1"
        ],
        "composite": [
          "node/18.13.0",
          "node/22.5.1"
        ]
      }
    }
  },
  "php": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.8.4"
      ]
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "PHP"
        ],
        "version": [
          "8.0.30"
        ],
        "composite": [
          "PHP/8.0.30"
        ]
      },
      "runtime": {
        "name": [
          "PHP"
        ],
        "version": [
          "8.0.30"
        ],
        "composite": [
          "PHP/8.0.30"
        ]
      }
    }
  },
  "python": {
    "agent": {
      "activation_method": [
        "unknown"
      ],
      "version": [
        "6.22.3"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "django"
        ],
        "version": [
          "5.0.7"
        ],
        "composite": [
          "django/5.0.7"
        ]
      },
      "language": {
        "name": [
          "python"
        ],
        "version": [
          "3.12.4"
        ],
        "composite": [
          "python/3.12.4"
        ]
      },
      "runtime": {
        "name": [
          "AWS_lambda",
          "CPython"
        ],
        "version": [
          "3.12.4"
        ],
        "composite": [
          "CPython/3.12.4"
        ]
      }
    }
  },
  "ruby": {
    "agent": {
      "activation_method": [],
      "version": [
        "4.7.3"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "Ruby on Rails"
        ],
        "version": [
          "6.1.4.1"
        ],
        "composite": [
          "Ruby on Rails/6.1.4.1"
        ]
      },
      "language": {
        "name": [
          "ruby"
        ],
        "version": [
          "2.7.3"
        ],
        "composite": [
          "ruby/2.7.3"
        ]
      },
      "runtime": {
        "name": [
          "ruby"
        ],
        "version": [
          "2.7.3"
        ],
        "composite": [
          "ruby/2.7.3"
        ]
      }
    }
  },
  "rum-js": {
    "agent": {
      "activation_method": [],
      "version": [
        "5.16.0"
      ]
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "javascript"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "android/java": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [
          "Android Activity"
        ],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "java"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "Android Runtime"
        ],
        "version": [
          "2.1.0",
          "1.9.0",
          "2.0.0"
        ],
        "composite": [
          "Android Runtime/2.1.0",
          "Android Runtime/1.9.0",
          "Android Runtime/2.0.0"
        ]
      }
    }
  },
  "otlp": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/cpp": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/dotnet": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.4.0.802"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "OpenTelemetry.Instrumentation.Runtime"
        ],
        "version": [
          "1.1.0.2"
        ],
        "composite": [
          "OpenTelemetry.Instrumentation.Runtime/1.1.0.2"
        ]
      },
      "language": {
        "name": [
          "dotnet"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/erlang": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.2.1"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "opentelemetry_ecto",
          "opentelemetry_phoenix"
        ],
        "version": [
          "1.0.0"
        ],
        "composite": [
          "opentelemetry_ecto/1.0.0",
          "opentelemetry_phoenix/1.0.0"
        ]
      },
      "language": {
        "name": [
          "erlang"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "BEAM"
        ],
        "version": [
          "11.2.2.8"
        ],
        "composite": [
          "BEAM/11.2.2.8"
        ]
      }
    }
  },
  "opentelemetry/go": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.10.0",
        "1.11.2"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "go.opentelemetry.io/contrib/instrumentation/runtime"
        ],
        "version": [
          "semver:0.36.1",
          "semver:0.36.4"
        ],
        "composite": [
          "go.opentelemetry.io/contrib/instrumentation/runtime/semver:0.36.4",
          "go.opentelemetry.io/contrib/instrumentation/runtime/semver:0.36.1"
        ]
      },
      "language": {
        "name": [
          "go"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "go"
        ],
        "version": [
          "go1.19.2",
          "go1.19.4"
        ],
        "composite": [
          "go/go1.19.4",
          "go/go1.19.2"
        ]
      }
    }
  },
  "opentelemetry/java": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.10.1",
        "1.23.1",
        "1.24.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "io.opentelemetry.tomcat-10.0",
          "io.opentelemetry.jdbc",
          "io.opentelemetry.spring-data-1.8"
        ],
        "version": [
          "1.10.1",
          "1.23.0-alpha",
          "1.24.0-alpha"
        ],
        "composite": [
          "io.opentelemetry.tomcat-10.0/1.10.1",
          "io.opentelemetry.jdbc/1.10.1",
          "io.opentelemetry.spring-data-1.8/1.10.1"
        ]
      },
      "language": {
        "name": [
          "java"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "OpenJDK Runtime Environment"
        ],
        "version": [
          "17.0.12+7",
          "11.0.18+10-LTS",
          "17.0.6+10-Debian-1deb11u1"
        ],
        "composite": [
          "OpenJDK Runtime Environment/17.0.12+7",
          "OpenJDK Runtime Environment/11.0.18+10-LTS",
          "OpenJDK Runtime Environment/17.0.6+10-Debian-1deb11u1"
        ]
      }
    }
  },
  "opentelemetry/nodejs": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.10.1",
        "1.9.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "@opentelemetry/instrumentation-fs",
          "@opentelemetry/instrumentation-http",
          "@opentelemetry/instrumentation-net"
        ],
        "version": [
          "0.7.1",
          "0.6.0",
          "0.35.1"
        ],
        "composite": [
          "@opentelemetry/instrumentation-fs/0.7.1",
          "@opentelemetry/instrumentation-fs/0.6.0",
          "@opentelemetry/instrumentation-http/0.35.1"
        ]
      },
      "language": {
        "name": [
          "nodejs"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "nodejs"
        ],
        "version": [
          "18.16.0",
          "16.20.0"
        ],
        "composite": [
          "nodejs/18.16.0",
          "nodejs/16.20.0"
        ]
      }
    }
  },
  "opentelemetry/php": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/python": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.15.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "opentelemetry.instrumentation.system_metrics"
        ],
        "version": [
          "0.36b0"
        ],
        "composite": [
          "opentelemetry.instrumentation.system_metrics/0.36b0"
        ]
      },
      "language": {
        "name": [
          "python"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/ruby": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/rust": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/android": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/webjs": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/cpp": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/dotnet": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/erlang": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/go": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/java": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/nodejs": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/php": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/python": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/ruby": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/rust": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/android": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/webjs": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "ios/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  }
}
`Agents` task new output:
{
  "dotnet": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.19.0+f72bf10e024b0bad4601ccda7fdea7db46c71640"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "ASP.NET Core"
        ],
        "version": [
          "3.1.7.0"
        ],
        "composite": [
          "ASP.NET Core/3.1.7.0"
        ]
      },
      "language": {
        "name": [
          "C#"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "AWS_lambda",
          ".NET Core"
        ],
        "version": [
          "3.1.7"
        ],
        "composite": [
          ".NET Core/3.1.7"
        ]
      }
    }
  },
  "go": {
    "agent": {
      "activation_method": [],
      "version": [
        "2.6.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "gin"
        ],
        "version": [
          "v1.10.0"
        ],
        "composite": [
          "gin/v1.10.0"
        ]
      },
      "language": {
        "name": [
          "go"
        ],
        "version": [
          "go1.22.7",
          "go1.18.3"
        ],
        "composite": [
          "go/go1.22.7",
          "go/go1.18.3"
        ]
      },
      "runtime": {
        "name": [
          "gc"
        ],
        "version": [
          "go1.22.7",
          "go1.18.3"
        ],
        "composite": [
          "gc/go1.22.7",
          "gc/go1.18.3"
        ]
      }
    }
  },
  "iOS/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [
          "iOS"
        ],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "java"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "iOS"
        ],
        "version": [
          "13",
          "9",
          "11"
        ],
        "composite": [
          "iOS/13",
          "iOS/9",
          "iOS/11"
        ]
      }
    }
  },
  "java": {
    "agent": {
      "activation_method": [
        "k8s-attach"
      ],
      "version": [
        "1.38.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "Spring Web MVC",
          "Servlet API"
        ],
        "version": [
          "6.1.11"
        ],
        "composite": [
          "Spring Web MVC/6.1.11"
        ]
      },
      "language": {
        "name": [
          "Java"
        ],
        "version": [
          "17.0.12"
        ],
        "composite": [
          "Java/17.0.12"
        ]
      },
      "runtime": {
        "name": [
          "Java"
        ],
        "version": [
          "17.0.12"
        ],
        "composite": [
          "Java/17.0.12"
        ]
      }
    }
  },
  "js-base": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "nodejs": {
    "agent": {
      "activation_method": [
        "env-attach",
        "require"
      ],
      "version": [
        "3.46.0",
        "4.7.2"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "express"
        ],
        "version": [
          "4.19.2",
          "4.18.2"
        ],
        "composite": [
          "express/4.19.2",
          "express/4.18.2"
        ]
      },
      "language": {
        "name": [
          "javascript"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "AWS_lambda",
          "node"
        ],
        "version": [
          "18.13.0",
          "22.5.1"
        ],
        "composite": [
          "node/18.13.0",
          "node/22.5.1"
        ]
      }
    }
  },
  "php": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.8.4"
      ]
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "PHP"
        ],
        "version": [
          "8.0.30"
        ],
        "composite": [
          "PHP/8.0.30"
        ]
      },
      "runtime": {
        "name": [
          "PHP"
        ],
        "version": [
          "8.0.30"
        ],
        "composite": [
          "PHP/8.0.30"
        ]
      }
    }
  },
  "python": {
    "agent": {
      "activation_method": [
        "unknown"
      ],
      "version": [
        "6.22.3"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "django"
        ],
        "version": [
          "5.0.7"
        ],
        "composite": [
          "django/5.0.7"
        ]
      },
      "language": {
        "name": [
          "python"
        ],
        "version": [
          "3.12.4"
        ],
        "composite": [
          "python/3.12.4"
        ]
      },
      "runtime": {
        "name": [
          "AWS_lambda",
          "CPython"
        ],
        "version": [
          "3.12.4"
        ],
        "composite": [
          "CPython/3.12.4"
        ]
      }
    }
  },
  "ruby": {
    "agent": {
      "activation_method": [],
      "version": [
        "4.7.3"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "Ruby on Rails"
        ],
        "version": [
          "6.1.4.1"
        ],
        "composite": [
          "Ruby on Rails/6.1.4.1"
        ]
      },
      "language": {
        "name": [
          "ruby"
        ],
        "version": [
          "2.7.3"
        ],
        "composite": [
          "ruby/2.7.3"
        ]
      },
      "runtime": {
        "name": [
          "ruby"
        ],
        "version": [
          "2.7.3"
        ],
        "composite": [
          "ruby/2.7.3"
        ]
      }
    }
  },
  "rum-js": {
    "agent": {
      "activation_method": [],
      "version": [
        "5.16.0"
      ]
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "javascript"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "android/java": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [
          "Android Activity"
        ],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "java"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "Android Runtime"
        ],
        "version": [
          "2.1.0",
          "1.9.0",
          "2.0.0"
        ],
        "composite": [
          "Android Runtime/2.1.0",
          "Android Runtime/1.9.0",
          "Android Runtime/2.0.0"
        ]
      }
    }
  },
  "ios/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/cpp": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/dotnet": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.4.0.802"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "OpenTelemetry.Instrumentation.Runtime"
        ],
        "version": [
          "1.1.0.2"
        ],
        "composite": [
          "OpenTelemetry.Instrumentation.Runtime/1.1.0.2"
        ]
      },
      "language": {
        "name": [
          "dotnet"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/erlang": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.2.1"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "opentelemetry_ecto",
          "opentelemetry_phoenix"
        ],
        "version": [
          "1.0.0"
        ],
        "composite": [
          "opentelemetry_ecto/1.0.0",
          "opentelemetry_phoenix/1.0.0"
        ]
      },
      "language": {
        "name": [
          "erlang"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "BEAM"
        ],
        "version": [
          "11.2.2.8"
        ],
        "composite": [
          "BEAM/11.2.2.8"
        ]
      }
    }
  },
  "opentelemetry/go": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.10.0",
        "1.11.2"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "go.opentelemetry.io/contrib/instrumentation/runtime"
        ],
        "version": [
          "semver:0.36.1",
          "semver:0.36.4"
        ],
        "composite": [
          "go.opentelemetry.io/contrib/instrumentation/runtime/semver:0.36.4",
          "go.opentelemetry.io/contrib/instrumentation/runtime/semver:0.36.1"
        ]
      },
      "language": {
        "name": [
          "go"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "go"
        ],
        "version": [
          "go1.19.2",
          "go1.19.4"
        ],
        "composite": [
          "go/go1.19.4",
          "go/go1.19.2"
        ]
      }
    }
  },
  "opentelemetry/java": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.10.1",
        "1.23.1",
        "1.24.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "io.opentelemetry.tomcat-10.0",
          "io.opentelemetry.jdbc",
          "io.opentelemetry.spring-data-1.8"
        ],
        "version": [
          "1.10.1",
          "1.23.0-alpha",
          "1.24.0-alpha"
        ],
        "composite": [
          "io.opentelemetry.tomcat-10.0/1.10.1",
          "io.opentelemetry.jdbc/1.10.1",
          "io.opentelemetry.spring-data-1.8/1.10.1"
        ]
      },
      "language": {
        "name": [
          "java"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "OpenJDK Runtime Environment"
        ],
        "version": [
          "17.0.12+7",
          "11.0.18+10-LTS",
          "17.0.6+10-Debian-1deb11u1"
        ],
        "composite": [
          "OpenJDK Runtime Environment/17.0.12+7",
          "OpenJDK Runtime Environment/11.0.18+10-LTS",
          "OpenJDK Runtime Environment/17.0.6+10-Debian-1deb11u1"
        ]
      }
    }
  },
  "opentelemetry/nodejs": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.10.1",
        "1.9.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "@opentelemetry/instrumentation-fs",
          "@opentelemetry/instrumentation-http",
          "@opentelemetry/instrumentation-net"
        ],
        "version": [
          "0.7.1",
          "0.6.0",
          "0.35.1"
        ],
        "composite": [
          "@opentelemetry/instrumentation-fs/0.7.1",
          "@opentelemetry/instrumentation-fs/0.6.0",
          "@opentelemetry/instrumentation-http/0.35.1"
        ]
      },
      "language": {
        "name": [
          "nodejs"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "nodejs"
        ],
        "version": [
          "18.16.0",
          "16.20.0"
        ],
        "composite": [
          "nodejs/18.16.0",
          "nodejs/16.20.0"
        ]
      }
    }
  },
  "opentelemetry/php": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/python": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.15.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "opentelemetry.instrumentation.system_metrics"
        ],
        "version": [
          "0.36b0"
        ],
        "composite": [
          "opentelemetry.instrumentation.system_metrics/0.36b0"
        ]
      },
      "language": {
        "name": [
          "python"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/ruby": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/rust": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/android": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/webjs": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/cpp": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/dotnet": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/erlang": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/go": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/java": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/nodejs": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/php": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/python": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/ruby": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/rust": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/android": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/webjs": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  }
}

@miloszmarcinkowski miloszmarcinkowski self-assigned this Oct 9, 2024
@miloszmarcinkowski miloszmarcinkowski requested review from a team as code owners October 9, 2024 13:15
@miloszmarcinkowski miloszmarcinkowski linked an issue Oct 9, 2024 that may be closed by this pull request
@miloszmarcinkowski miloszmarcinkowski added the Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team label Oct 9, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

@miloszmarcinkowski miloszmarcinkowski added backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) apm apm:opentelemetry APM UI - OTEL Work release_note:fix labels Oct 9, 2024
@miloszmarcinkowski miloszmarcinkowski requested a review from a team as a code owner October 10, 2024 12:05
@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Oct 10, 2024
@miloszmarcinkowski miloszmarcinkowski force-pushed the 195583-apmotel-make-agent-names-generic-for-otel branch 2 times, most recently from c22edc0 to 785d625 Compare October 10, 2024 14:18
@miloszmarcinkowski
Copy link
Contributor Author

Hi @AlexanderWert

cc: @crespocarlos

Internal APM telemetry groups few things based on Agent name. (see service and agents tasks).

Previously, we've been relying on fixed agent name list to group data when querying ES. Since, we expect unknown agent names starting from opentelemetry/ or otlp/ I had to modify above tasks to group agent names by unique value instead of using the list.

When it comes to three-part agent names, like opentelemetry/java/elastic. How we suppose to collect them in APM telemetry?

  1. Each under unique key:
{
  opentelemetry/java/elastic: 1
  opentelemetry/java/opentelemetry-instrumentation: 1
  opentelemetry/java/some-other-distro: 1
}
  1. Or grouping them under the same language:
{
  opentelemetry/java: 3
}

Let me know what do you think. Thanks!

@AlexanderWert
Copy link
Member

AlexanderWert commented Oct 10, 2024

It would be good for us to differentiate three cases for telemetry:

  • our Elastic distro
  • vanilla OTel distro
  • any other distro
{
  opentelemetry/java/elastic: 1
  opentelemetry/java/opentelemetry-instrumentation: 1
  opentelemetry/java/any-other: 1                     <-- that would group everything else
}

Would that be possible?

};
});
}, Promise.resolve({} as Record<AgentName, number>));
const servicesPerAgent = response.aggregations?.group_by_agent_name.buckets.reduce(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The telemetry api integration test fails on the stats.stack_stats.kibana.plugins.apm.services_per_agent assertion. services_per_agent doesn't exist in the schema:

`stats.stack_stats.kibana.plugins.apm:`
{ tasks:
    { aggregated_transactions: { took: [Object] },
      cloud: { took: [Object] },
      host: { took: [Object] },
      environments: { took: [Object] },
      processor_events: { took: [Object] },
      agent_configuration: { took: [Object] },
      global_labels: { took: [Object] },
      services: { took: [Object] },
      versions: { took: [Object] },
      groupings: { took: [Object] },
      integrations: { took: [Object] },
      agents: { took: [Object] },
      indices_stats: { took: [Object] },
      cardinality: { took: [Object] },
      service_groups: { took: [Object] },
      custom_dashboards: { took: [Object] },
      per_service: { took: [Object] },
      top_traces: { took: [Object] } },
   cloud: { availability_zone: [], provider: [], region: [] },
   host: { os: { platform: [] } },
   environments:
    { services_without_environment: 0,
      services_with_multiple_environments: 0,
      top_environments: [] },
   counts:
    { error: { '1d': 0, all: 0 },
      metric: { '1d': 0, all: 0 },
      span: { '1d': 0, all: 0 },
      transaction: { '1d': 0, all: 0 },
      onboarding: { '1d': 0, all: 0 },
      agent_configuration: { all: 0 },
      global_labels: { '1d': 0 },
      max_error_groups_per_service: { '1d': 0 },
      max_transaction_groups_per_service: { '1d': 0 },
      traces: { '1d': 0 },
      services: { '1d': 0 },
      environments: { '1d': 0 },
      span_destination_service_resource: { '1d': 0 } },
   has_any_services_per_official_agent: false,
   has_any_services: false,
   integrations: { ml: { all_jobs_count: 0 } },
   indices:
    { metric:
       { shards: [Object],
         all: [Object],
         metricset: [Object] },
      traces: { shards: [Object], all: [Object] },
      shards: { total: 1 },
      all: { total: [Object] } },
   cardinality:
    { client: { geo: [Object] },
      transaction: { name: [Object] },
      user_agent: { original: [Object] } },
   service_groups: { kuery_fields: [], total: 0 },
   custom_dashboards: { kuery_fields: [], total: 0 },
   per_service: [],
   top_traces: { max: 0, median: 0 } }

@miloszmarcinkowski miloszmarcinkowski marked this pull request as draft October 11, 2024 09:01
@miloszmarcinkowski miloszmarcinkowski force-pushed the 195583-apmotel-make-agent-names-generic-for-otel branch from 780b5e7 to bc7dc5f Compare October 11, 2024 14:45
@miloszmarcinkowski
Copy link
Contributor Author

It would be good for us to differentiate three cases for telemetry:

  • our Elastic distro
  • vanilla OTel distro
  • any other distro
{
  opentelemetry/java/elastic: 1
  opentelemetry/java/opentelemetry-instrumentation: 1
  opentelemetry/java/any-other: 1                     <-- that would group everything else
}

Would that be possible?

@AlexanderWert It could be possible, preferably using JS to format data because ES query is already heavy.

However, I would opt for grouping agent names by unique value, as it's done in this PR. We already introduced new complexity by handling opentelemetry/* and otlp/* and I would prefer to get it done in the first place.

In case the mentioned format is still needed. Could you please create a separate ticket for this? Thank you!

const agentData = aggregations?.agent_name.buckets.reduce((acc, agentNamesAggs) => {
return {
...acc,
[agentName]: {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we run two ES queries, the first one for known agent names and the second for generic otel agent names (otlp/* and opentelemetry/*) the part of the code responsible for formatting response data become duplicated. I tried to separate it but I run into typing issue. The problem is that agentNamesAggs type is inferred from the telemetryClient.search response, therefore it isn't known ahead of time to define it in the function.

this is duplicated part:

{
  agent: {
    activation_method: aggregations[AGENT_ACTIVATION_METHOD].buckets
      .map((bucket) => bucket.key as string)
  .slice(0, size),
      version: aggregations[AGENT_VERSION].buckets.map((bucket) => bucket.key as string),
  },
  service: {
    framework: {
      name: aggregations[SERVICE_FRAMEWORK_NAME].buckets
        .map((bucket) => bucket.key as string)
    .slice(0, size),
        version: aggregations[SERVICE_FRAMEWORK_VERSION].buckets
        .map((bucket) => bucket.key as string)
    .slice(0, size),
        composite: sortBy(
        flatten(
          aggregations[SERVICE_FRAMEWORK_NAME].buckets.map((bucket) =>
            bucket[SERVICE_FRAMEWORK_VERSION].buckets.map((versionBucket) => ({
              doc_count: versionBucket.doc_count,
              name: toComposite(bucket.key, versionBucket.key),
            }))
          )
        ),
        'doc_count'
      )
        .reverse()
        .slice(0, size)
        .map((composite) => composite.name),
    },
    language: {
      name: aggregations[SERVICE_LANGUAGE_NAME].buckets
        .map((bucket) => bucket.key as string)
    .slice(0, size),
        version: aggregations[SERVICE_LANGUAGE_VERSION].buckets
        .map((bucket) => bucket.key as string)
    .slice(0, size),
        composite: sortBy(
        flatten(
          aggregations[SERVICE_LANGUAGE_NAME].buckets.map((bucket) =>
            bucket[SERVICE_LANGUAGE_VERSION].buckets.map((versionBucket) => ({
              doc_count: versionBucket.doc_count,
              name: toComposite(bucket.key, versionBucket.key),
            }))
          )
        ),
        'doc_count'
      )
        .reverse()
        .slice(0, size)
        .map((composite) => composite.name),
    },
    runtime: {
      name: aggregations[SERVICE_RUNTIME_NAME].buckets
        .map((bucket) => bucket.key as string)
    .slice(0, size),
        version: aggregations[SERVICE_RUNTIME_VERSION].buckets
        .map((bucket) => bucket.key as string)
    .slice(0, size),
        composite: sortBy(
        flatten(
          aggregations[SERVICE_RUNTIME_NAME].buckets.map((bucket) =>
            bucket[SERVICE_RUNTIME_VERSION].buckets.map((versionBucket) => ({
              doc_count: versionBucket.doc_count,
              name: toComposite(bucket.key, versionBucket.key),
            }))
          )
        ),
        'doc_count'
      )
        .reverse()
        .slice(0, size)
        .map((composite) => composite.name),
    },
  },
}

@miloszmarcinkowski miloszmarcinkowski force-pushed the 195583-apmotel-make-agent-names-generic-for-otel branch from a0e3e37 to eef5035 Compare October 14, 2024 08:44
@miloszmarcinkowski miloszmarcinkowski changed the title [APM][OTel] Make agent names generic for Otel [APM][OTel] Make agent names generic with Otel native mode Oct 14, 2024
@miloszmarcinkowski miloszmarcinkowski changed the title [APM][OTel] Make agent names generic with Otel native mode [APM][OTel] Make agent names generic with otel-native mode Oct 14, 2024
@miloszmarcinkowski miloszmarcinkowski force-pushed the 195583-apmotel-make-agent-names-generic-for-otel branch from eef5035 to 4806d23 Compare October 14, 2024 13:27
@miloszmarcinkowski miloszmarcinkowski marked this pull request as ready for review October 14, 2024 13:27
@miloszmarcinkowski miloszmarcinkowski requested a review from a team as a code owner October 14, 2024 13:27
@miloszmarcinkowski miloszmarcinkowski force-pushed the 195583-apmotel-make-agent-names-generic-for-otel branch from d4c0196 to 72c0509 Compare October 15, 2024 09:02
@miloszmarcinkowski miloszmarcinkowski force-pushed the 195583-apmotel-make-agent-names-generic-for-otel branch from 72c0509 to 7cf5393 Compare October 15, 2024 09:33
@miloszmarcinkowski miloszmarcinkowski force-pushed the 195583-apmotel-make-agent-names-generic-for-otel branch from 7cf5393 to 491f8fa Compare October 15, 2024 10:07
Copy link
Contributor

@crespocarlos crespocarlos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM. Great job!

Copy link
Contributor

@TinaHeiligers TinaHeiligers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

telemetry check passes and the related code is good.
LGTM

Copy link
Contributor

@tonyghiani tonyghiani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agent utils changes LGTM

@elasticmachine
Copy link
Contributor

⏳ Build in-progress

  • Buildkite Build
  • Commit: aa1969c
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-195594-aa1969cba226

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #8 / Actions and Triggers app create alert should add filter

History

cc @miloszmarcinkowski

@miloszmarcinkowski miloszmarcinkowski enabled auto-merge (squash) October 16, 2024 08:25
@miloszmarcinkowski miloszmarcinkowski merged commit 70d1597 into elastic:main Oct 16, 2024
25 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11362524117

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 16, 2024
…95594)

Closes elastic#195583

### Summary

In the effort of making [APM UI work with otel-native
mode](elastic/opentelemetry-dev#385) we
introduced possibility for having any kind of agent names matching the
following format: `opentelemetry/*` or `otlp/*`.

This change forced us to modify the way we collect data in 'services'
and 'agents' tasks in apm telemetry.

Before the change, we could group data by agent names that were known
ahead of time.

Right now, for opentelemetry agents, we have to group them by unique
values. To achieve the following, we decided to run two ES queries:

1. Collects data by the known list of non-opentelemetry agents names
(the same approach as before but without opentelemetry agent names)
2. (_New_) Collects data starting from `opentelemetry/*` or `otlp/*` and
group them by unique value

To achieve backward compatibility, we initialize previously known
`opentelemetry/*` or `otlp/*` agent names with empty values before
collecting data. This way the new collectors match the old format,
adding only unique opentelemetry agent names.

### How to test
1. Change schedule interval to `1m` (default `720m`) in
`x-pack/plugins/observability_solution/apm/server/lib/apm_telemetry/index.ts`
2. Run kibana server in debug mode (`yarn debug-break`) and place
breakpoints in 'services' and 'agents' in
`x-pack/plugins/observability_solution/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.ts`
3. Verify tasks outputs:
<details>
<summary>`Services` task old output:</summary>

```json
{
  "dotnet": 6,
  "go": 22,
  "iOS/swift": 1,
  "java": 11,
  "js-base": 0,
  "nodejs": 12,
  "php": 1,
  "python": 2,
  "ruby": 2,
  "rum-js": 3,
  "android/java": 1,
  "ios/swift": 0,
  "otlp": 0,
  "opentelemetry": 0,
  "opentelemetry/cpp": 0,
  "opentelemetry/dotnet": 1,
  "opentelemetry/erlang": 1,
  "opentelemetry/go": 2,
  "opentelemetry/java": 4,
  "opentelemetry/nodejs": 2,
  "opentelemetry/php": 0,
  "opentelemetry/python": 1,
  "opentelemetry/ruby": 0,
  "opentelemetry/rust": 0,
  "opentelemetry/swift": 0,
  "opentelemetry/android": 0,
  "opentelemetry/webjs": 0,
  "otlp/cpp": 0,
  "otlp/dotnet": 0,
  "otlp/erlang": 0,
  "otlp/go": 0,
  "otlp/java": 0,
  "otlp/nodejs": 0,
  "otlp/php": 0,
  "otlp/python": 0,
  "otlp/ruby": 0,
  "otlp/rust": 0,
  "otlp/swift": 0,
  "otlp/android": 0,
  "otlp/webjs": 0
}
```
</details>
<details>
<summary>`Services` task new output:</summary>

```json
{
  "dotnet": 6,
  "go": 22,
  "iOS/swift": 1,
  "java": 11,
  "js-base": 0,
  "nodejs": 12,
  "php": 1,
  "python": 2,
  "ruby": 2,
  "rum-js": 3,
  "android/java": 1,
  "otlp": 0,
  "opentelemetry": 0,
  "opentelemetry/cpp": 0,
  "opentelemetry/dotnet": 1,
  "opentelemetry/erlang": 1,
  "opentelemetry/go": 2,
  "opentelemetry/java": 4,
  "opentelemetry/nodejs": 2,
  "opentelemetry/php": 0,
  "opentelemetry/python": 1,
  "opentelemetry/ruby": 0,
  "opentelemetry/rust": 0,
  "opentelemetry/swift": 0,
  "opentelemetry/android": 0,
  "opentelemetry/webjs": 0,
  "otlp/cpp": 0,
  "otlp/dotnet": 0,
  "otlp/erlang": 0,
  "otlp/go": 0,
  "otlp/java": 0,
  "otlp/nodejs": 0,
  "otlp/php": 0,
  "otlp/python": 0,
  "otlp/ruby": 0,
  "otlp/rust": 0,
  "otlp/swift": 0,
  "otlp/android": 0,
  "otlp/webjs": 0,
  "ios/swift": 0
}
```
</details>
<details>
<summary>`Agents` task old output:</summary>

```json
{
  "dotnet": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.19.0+f72bf10e024b0bad4601ccda7fdea7db46c71640"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "ASP.NET Core"
        ],
        "version": [
          "3.1.7.0"
        ],
        "composite": [
          "ASP.NET Core/3.1.7.0"
        ]
      },
      "language": {
        "name": [
          "C#"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "AWS_lambda",
          ".NET Core"
        ],
        "version": [
          "3.1.7"
        ],
        "composite": [
          ".NET Core/3.1.7"
        ]
      }
    }
  },
  "go": {
    "agent": {
      "activation_method": [],
      "version": [
        "2.6.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "gin"
        ],
        "version": [
          "v1.10.0"
        ],
        "composite": [
          "gin/v1.10.0"
        ]
      },
      "language": {
        "name": [
          "go"
        ],
        "version": [
          "go1.22.7",
          "go1.18.3"
        ],
        "composite": [
          "go/go1.22.7",
          "go/go1.18.3"
        ]
      },
      "runtime": {
        "name": [
          "gc"
        ],
        "version": [
          "go1.22.7",
          "go1.18.3"
        ],
        "composite": [
          "gc/go1.22.7",
          "gc/go1.18.3"
        ]
      }
    }
  },
  "iOS/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [
          "iOS"
        ],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "java"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "iOS"
        ],
        "version": [
          "13",
          "9",
          "11"
        ],
        "composite": [
          "iOS/13",
          "iOS/9",
          "iOS/11"
        ]
      }
    }
  },
  "java": {
    "agent": {
      "activation_method": [
        "k8s-attach"
      ],
      "version": [
        "1.38.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "Spring Web MVC",
          "Servlet API"
        ],
        "version": [
          "6.1.11"
        ],
        "composite": [
          "Spring Web MVC/6.1.11"
        ]
      },
      "language": {
        "name": [
          "Java"
        ],
        "version": [
          "17.0.12"
        ],
        "composite": [
          "Java/17.0.12"
        ]
      },
      "runtime": {
        "name": [
          "Java"
        ],
        "version": [
          "17.0.12"
        ],
        "composite": [
          "Java/17.0.12"
        ]
      }
    }
  },
  "js-base": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "nodejs": {
    "agent": {
      "activation_method": [
        "env-attach",
        "require"
      ],
      "version": [
        "3.46.0",
        "4.7.2"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "express"
        ],
        "version": [
          "4.19.2",
          "4.18.2"
        ],
        "composite": [
          "express/4.19.2",
          "express/4.18.2"
        ]
      },
      "language": {
        "name": [
          "javascript"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "AWS_lambda",
          "node"
        ],
        "version": [
          "18.13.0",
          "22.5.1"
        ],
        "composite": [
          "node/18.13.0",
          "node/22.5.1"
        ]
      }
    }
  },
  "php": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.8.4"
      ]
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "PHP"
        ],
        "version": [
          "8.0.30"
        ],
        "composite": [
          "PHP/8.0.30"
        ]
      },
      "runtime": {
        "name": [
          "PHP"
        ],
        "version": [
          "8.0.30"
        ],
        "composite": [
          "PHP/8.0.30"
        ]
      }
    }
  },
  "python": {
    "agent": {
      "activation_method": [
        "unknown"
      ],
      "version": [
        "6.22.3"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "django"
        ],
        "version": [
          "5.0.7"
        ],
        "composite": [
          "django/5.0.7"
        ]
      },
      "language": {
        "name": [
          "python"
        ],
        "version": [
          "3.12.4"
        ],
        "composite": [
          "python/3.12.4"
        ]
      },
      "runtime": {
        "name": [
          "AWS_lambda",
          "CPython"
        ],
        "version": [
          "3.12.4"
        ],
        "composite": [
          "CPython/3.12.4"
        ]
      }
    }
  },
  "ruby": {
    "agent": {
      "activation_method": [],
      "version": [
        "4.7.3"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "Ruby on Rails"
        ],
        "version": [
          "6.1.4.1"
        ],
        "composite": [
          "Ruby on Rails/6.1.4.1"
        ]
      },
      "language": {
        "name": [
          "ruby"
        ],
        "version": [
          "2.7.3"
        ],
        "composite": [
          "ruby/2.7.3"
        ]
      },
      "runtime": {
        "name": [
          "ruby"
        ],
        "version": [
          "2.7.3"
        ],
        "composite": [
          "ruby/2.7.3"
        ]
      }
    }
  },
  "rum-js": {
    "agent": {
      "activation_method": [],
      "version": [
        "5.16.0"
      ]
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "javascript"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "android/java": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [
          "Android Activity"
        ],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "java"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "Android Runtime"
        ],
        "version": [
          "2.1.0",
          "1.9.0",
          "2.0.0"
        ],
        "composite": [
          "Android Runtime/2.1.0",
          "Android Runtime/1.9.0",
          "Android Runtime/2.0.0"
        ]
      }
    }
  },
  "otlp": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/cpp": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/dotnet": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.4.0.802"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "OpenTelemetry.Instrumentation.Runtime"
        ],
        "version": [
          "1.1.0.2"
        ],
        "composite": [
          "OpenTelemetry.Instrumentation.Runtime/1.1.0.2"
        ]
      },
      "language": {
        "name": [
          "dotnet"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/erlang": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.2.1"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "opentelemetry_ecto",
          "opentelemetry_phoenix"
        ],
        "version": [
          "1.0.0"
        ],
        "composite": [
          "opentelemetry_ecto/1.0.0",
          "opentelemetry_phoenix/1.0.0"
        ]
      },
      "language": {
        "name": [
          "erlang"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "BEAM"
        ],
        "version": [
          "11.2.2.8"
        ],
        "composite": [
          "BEAM/11.2.2.8"
        ]
      }
    }
  },
  "opentelemetry/go": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.10.0",
        "1.11.2"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "go.opentelemetry.io/contrib/instrumentation/runtime"
        ],
        "version": [
          "semver:0.36.1",
          "semver:0.36.4"
        ],
        "composite": [
          "go.opentelemetry.io/contrib/instrumentation/runtime/semver:0.36.4",
          "go.opentelemetry.io/contrib/instrumentation/runtime/semver:0.36.1"
        ]
      },
      "language": {
        "name": [
          "go"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "go"
        ],
        "version": [
          "go1.19.2",
          "go1.19.4"
        ],
        "composite": [
          "go/go1.19.4",
          "go/go1.19.2"
        ]
      }
    }
  },
  "opentelemetry/java": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.10.1",
        "1.23.1",
        "1.24.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "io.opentelemetry.tomcat-10.0",
          "io.opentelemetry.jdbc",
          "io.opentelemetry.spring-data-1.8"
        ],
        "version": [
          "1.10.1",
          "1.23.0-alpha",
          "1.24.0-alpha"
        ],
        "composite": [
          "io.opentelemetry.tomcat-10.0/1.10.1",
          "io.opentelemetry.jdbc/1.10.1",
          "io.opentelemetry.spring-data-1.8/1.10.1"
        ]
      },
      "language": {
        "name": [
          "java"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "OpenJDK Runtime Environment"
        ],
        "version": [
          "17.0.12+7",
          "11.0.18+10-LTS",
          "17.0.6+10-Debian-1deb11u1"
        ],
        "composite": [
          "OpenJDK Runtime Environment/17.0.12+7",
          "OpenJDK Runtime Environment/11.0.18+10-LTS",
          "OpenJDK Runtime Environment/17.0.6+10-Debian-1deb11u1"
        ]
      }
    }
  },
  "opentelemetry/nodejs": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.10.1",
        "1.9.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "@opentelemetry/instrumentation-fs",
          "@opentelemetry/instrumentation-http",
          "@opentelemetry/instrumentation-net"
        ],
        "version": [
          "0.7.1",
          "0.6.0",
          "0.35.1"
        ],
        "composite": [
          "@opentelemetry/instrumentation-fs/0.7.1",
          "@opentelemetry/instrumentation-fs/0.6.0",
          "@opentelemetry/instrumentation-http/0.35.1"
        ]
      },
      "language": {
        "name": [
          "nodejs"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "nodejs"
        ],
        "version": [
          "18.16.0",
          "16.20.0"
        ],
        "composite": [
          "nodejs/18.16.0",
          "nodejs/16.20.0"
        ]
      }
    }
  },
  "opentelemetry/php": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/python": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.15.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "opentelemetry.instrumentation.system_metrics"
        ],
        "version": [
          "0.36b0"
        ],
        "composite": [
          "opentelemetry.instrumentation.system_metrics/0.36b0"
        ]
      },
      "language": {
        "name": [
          "python"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/ruby": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/rust": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/android": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/webjs": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/cpp": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/dotnet": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/erlang": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/go": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/java": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/nodejs": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/php": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/python": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/ruby": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/rust": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/android": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/webjs": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "ios/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  }
}
```
</details>
<details>
<summary>`Agents` task new output:</summary>

```json
{
  "dotnet": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.19.0+f72bf10e024b0bad4601ccda7fdea7db46c71640"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "ASP.NET Core"
        ],
        "version": [
          "3.1.7.0"
        ],
        "composite": [
          "ASP.NET Core/3.1.7.0"
        ]
      },
      "language": {
        "name": [
          "C#"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "AWS_lambda",
          ".NET Core"
        ],
        "version": [
          "3.1.7"
        ],
        "composite": [
          ".NET Core/3.1.7"
        ]
      }
    }
  },
  "go": {
    "agent": {
      "activation_method": [],
      "version": [
        "2.6.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "gin"
        ],
        "version": [
          "v1.10.0"
        ],
        "composite": [
          "gin/v1.10.0"
        ]
      },
      "language": {
        "name": [
          "go"
        ],
        "version": [
          "go1.22.7",
          "go1.18.3"
        ],
        "composite": [
          "go/go1.22.7",
          "go/go1.18.3"
        ]
      },
      "runtime": {
        "name": [
          "gc"
        ],
        "version": [
          "go1.22.7",
          "go1.18.3"
        ],
        "composite": [
          "gc/go1.22.7",
          "gc/go1.18.3"
        ]
      }
    }
  },
  "iOS/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [
          "iOS"
        ],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "java"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "iOS"
        ],
        "version": [
          "13",
          "9",
          "11"
        ],
        "composite": [
          "iOS/13",
          "iOS/9",
          "iOS/11"
        ]
      }
    }
  },
  "java": {
    "agent": {
      "activation_method": [
        "k8s-attach"
      ],
      "version": [
        "1.38.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "Spring Web MVC",
          "Servlet API"
        ],
        "version": [
          "6.1.11"
        ],
        "composite": [
          "Spring Web MVC/6.1.11"
        ]
      },
      "language": {
        "name": [
          "Java"
        ],
        "version": [
          "17.0.12"
        ],
        "composite": [
          "Java/17.0.12"
        ]
      },
      "runtime": {
        "name": [
          "Java"
        ],
        "version": [
          "17.0.12"
        ],
        "composite": [
          "Java/17.0.12"
        ]
      }
    }
  },
  "js-base": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "nodejs": {
    "agent": {
      "activation_method": [
        "env-attach",
        "require"
      ],
      "version": [
        "3.46.0",
        "4.7.2"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "express"
        ],
        "version": [
          "4.19.2",
          "4.18.2"
        ],
        "composite": [
          "express/4.19.2",
          "express/4.18.2"
        ]
      },
      "language": {
        "name": [
          "javascript"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "AWS_lambda",
          "node"
        ],
        "version": [
          "18.13.0",
          "22.5.1"
        ],
        "composite": [
          "node/18.13.0",
          "node/22.5.1"
        ]
      }
    }
  },
  "php": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.8.4"
      ]
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "PHP"
        ],
        "version": [
          "8.0.30"
        ],
        "composite": [
          "PHP/8.0.30"
        ]
      },
      "runtime": {
        "name": [
          "PHP"
        ],
        "version": [
          "8.0.30"
        ],
        "composite": [
          "PHP/8.0.30"
        ]
      }
    }
  },
  "python": {
    "agent": {
      "activation_method": [
        "unknown"
      ],
      "version": [
        "6.22.3"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "django"
        ],
        "version": [
          "5.0.7"
        ],
        "composite": [
          "django/5.0.7"
        ]
      },
      "language": {
        "name": [
          "python"
        ],
        "version": [
          "3.12.4"
        ],
        "composite": [
          "python/3.12.4"
        ]
      },
      "runtime": {
        "name": [
          "AWS_lambda",
          "CPython"
        ],
        "version": [
          "3.12.4"
        ],
        "composite": [
          "CPython/3.12.4"
        ]
      }
    }
  },
  "ruby": {
    "agent": {
      "activation_method": [],
      "version": [
        "4.7.3"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "Ruby on Rails"
        ],
        "version": [
          "6.1.4.1"
        ],
        "composite": [
          "Ruby on Rails/6.1.4.1"
        ]
      },
      "language": {
        "name": [
          "ruby"
        ],
        "version": [
          "2.7.3"
        ],
        "composite": [
          "ruby/2.7.3"
        ]
      },
      "runtime": {
        "name": [
          "ruby"
        ],
        "version": [
          "2.7.3"
        ],
        "composite": [
          "ruby/2.7.3"
        ]
      }
    }
  },
  "rum-js": {
    "agent": {
      "activation_method": [],
      "version": [
        "5.16.0"
      ]
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "javascript"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "android/java": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [
          "Android Activity"
        ],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "java"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "Android Runtime"
        ],
        "version": [
          "2.1.0",
          "1.9.0",
          "2.0.0"
        ],
        "composite": [
          "Android Runtime/2.1.0",
          "Android Runtime/1.9.0",
          "Android Runtime/2.0.0"
        ]
      }
    }
  },
  "ios/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/cpp": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/dotnet": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.4.0.802"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "OpenTelemetry.Instrumentation.Runtime"
        ],
        "version": [
          "1.1.0.2"
        ],
        "composite": [
          "OpenTelemetry.Instrumentation.Runtime/1.1.0.2"
        ]
      },
      "language": {
        "name": [
          "dotnet"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/erlang": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.2.1"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "opentelemetry_ecto",
          "opentelemetry_phoenix"
        ],
        "version": [
          "1.0.0"
        ],
        "composite": [
          "opentelemetry_ecto/1.0.0",
          "opentelemetry_phoenix/1.0.0"
        ]
      },
      "language": {
        "name": [
          "erlang"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "BEAM"
        ],
        "version": [
          "11.2.2.8"
        ],
        "composite": [
          "BEAM/11.2.2.8"
        ]
      }
    }
  },
  "opentelemetry/go": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.10.0",
        "1.11.2"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "go.opentelemetry.io/contrib/instrumentation/runtime"
        ],
        "version": [
          "semver:0.36.1",
          "semver:0.36.4"
        ],
        "composite": [
          "go.opentelemetry.io/contrib/instrumentation/runtime/semver:0.36.4",
          "go.opentelemetry.io/contrib/instrumentation/runtime/semver:0.36.1"
        ]
      },
      "language": {
        "name": [
          "go"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "go"
        ],
        "version": [
          "go1.19.2",
          "go1.19.4"
        ],
        "composite": [
          "go/go1.19.4",
          "go/go1.19.2"
        ]
      }
    }
  },
  "opentelemetry/java": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.10.1",
        "1.23.1",
        "1.24.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "io.opentelemetry.tomcat-10.0",
          "io.opentelemetry.jdbc",
          "io.opentelemetry.spring-data-1.8"
        ],
        "version": [
          "1.10.1",
          "1.23.0-alpha",
          "1.24.0-alpha"
        ],
        "composite": [
          "io.opentelemetry.tomcat-10.0/1.10.1",
          "io.opentelemetry.jdbc/1.10.1",
          "io.opentelemetry.spring-data-1.8/1.10.1"
        ]
      },
      "language": {
        "name": [
          "java"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "OpenJDK Runtime Environment"
        ],
        "version": [
          "17.0.12+7",
          "11.0.18+10-LTS",
          "17.0.6+10-Debian-1deb11u1"
        ],
        "composite": [
          "OpenJDK Runtime Environment/17.0.12+7",
          "OpenJDK Runtime Environment/11.0.18+10-LTS",
          "OpenJDK Runtime Environment/17.0.6+10-Debian-1deb11u1"
        ]
      }
    }
  },
  "opentelemetry/nodejs": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.10.1",
        "1.9.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "@opentelemetry/instrumentation-fs",
          "@opentelemetry/instrumentation-http",
          "@opentelemetry/instrumentation-net"
        ],
        "version": [
          "0.7.1",
          "0.6.0",
          "0.35.1"
        ],
        "composite": [
          "@opentelemetry/instrumentation-fs/0.7.1",
          "@opentelemetry/instrumentation-fs/0.6.0",
          "@opentelemetry/instrumentation-http/0.35.1"
        ]
      },
      "language": {
        "name": [
          "nodejs"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "nodejs"
        ],
        "version": [
          "18.16.0",
          "16.20.0"
        ],
        "composite": [
          "nodejs/18.16.0",
          "nodejs/16.20.0"
        ]
      }
    }
  },
  "opentelemetry/php": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/python": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.15.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "opentelemetry.instrumentation.system_metrics"
        ],
        "version": [
          "0.36b0"
        ],
        "composite": [
          "opentelemetry.instrumentation.system_metrics/0.36b0"
        ]
      },
      "language": {
        "name": [
          "python"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/ruby": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/rust": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/android": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/webjs": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/cpp": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/dotnet": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/erlang": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/go": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/java": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/nodejs": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/php": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/python": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/ruby": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/rust": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/android": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/webjs": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  }
}
```
</details>

---------

Co-authored-by: Alejandro Fernández Haro <[email protected]>
(cherry picked from commit 70d1597)
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Could not create pull request: Validation Failed: {"resource":"Issue","code":"custom","field":"body","message":"body is too long (maximum is 65536 characters)"}

Manual backport

To create the backport manually run:

node scripts/backport --pr 195594

Questions ?

Please refer to the Backport tool documentation

miloszmarcinkowski added a commit to miloszmarcinkowski/kibana that referenced this pull request Oct 16, 2024
…95594)

Closes elastic#195583

### Summary

In the effort of making [APM UI work with otel-native
mode](elastic/opentelemetry-dev#385) we
introduced possibility for having any kind of agent names matching the
following format: `opentelemetry/*` or `otlp/*`.

This change forced us to modify the way we collect data in 'services'
and 'agents' tasks in apm telemetry.

Before the change, we could group data by agent names that were known
ahead of time.

Right now, for opentelemetry agents, we have to group them by unique
values. To achieve the following, we decided to run two ES queries:

1. Collects data by the known list of non-opentelemetry agents names
(the same approach as before but without opentelemetry agent names)
2. (_New_) Collects data starting from `opentelemetry/*` or `otlp/*` and
group them by unique value

To achieve backward compatibility, we initialize previously known
`opentelemetry/*` or `otlp/*` agent names with empty values before
collecting data. This way the new collectors match the old format,
adding only unique opentelemetry agent names.

### How to test
1. Change schedule interval to `1m` (default `720m`) in
`x-pack/plugins/observability_solution/apm/server/lib/apm_telemetry/index.ts`
2. Run kibana server in debug mode (`yarn debug-break`) and place
breakpoints in 'services' and 'agents' in
`x-pack/plugins/observability_solution/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.ts`
3. Verify tasks outputs:
<details>
<summary>`Services` task old output:</summary>

```json
{
  "dotnet": 6,
  "go": 22,
  "iOS/swift": 1,
  "java": 11,
  "js-base": 0,
  "nodejs": 12,
  "php": 1,
  "python": 2,
  "ruby": 2,
  "rum-js": 3,
  "android/java": 1,
  "ios/swift": 0,
  "otlp": 0,
  "opentelemetry": 0,
  "opentelemetry/cpp": 0,
  "opentelemetry/dotnet": 1,
  "opentelemetry/erlang": 1,
  "opentelemetry/go": 2,
  "opentelemetry/java": 4,
  "opentelemetry/nodejs": 2,
  "opentelemetry/php": 0,
  "opentelemetry/python": 1,
  "opentelemetry/ruby": 0,
  "opentelemetry/rust": 0,
  "opentelemetry/swift": 0,
  "opentelemetry/android": 0,
  "opentelemetry/webjs": 0,
  "otlp/cpp": 0,
  "otlp/dotnet": 0,
  "otlp/erlang": 0,
  "otlp/go": 0,
  "otlp/java": 0,
  "otlp/nodejs": 0,
  "otlp/php": 0,
  "otlp/python": 0,
  "otlp/ruby": 0,
  "otlp/rust": 0,
  "otlp/swift": 0,
  "otlp/android": 0,
  "otlp/webjs": 0
}
```
</details>
<details>
<summary>`Services` task new output:</summary>

```json
{
  "dotnet": 6,
  "go": 22,
  "iOS/swift": 1,
  "java": 11,
  "js-base": 0,
  "nodejs": 12,
  "php": 1,
  "python": 2,
  "ruby": 2,
  "rum-js": 3,
  "android/java": 1,
  "otlp": 0,
  "opentelemetry": 0,
  "opentelemetry/cpp": 0,
  "opentelemetry/dotnet": 1,
  "opentelemetry/erlang": 1,
  "opentelemetry/go": 2,
  "opentelemetry/java": 4,
  "opentelemetry/nodejs": 2,
  "opentelemetry/php": 0,
  "opentelemetry/python": 1,
  "opentelemetry/ruby": 0,
  "opentelemetry/rust": 0,
  "opentelemetry/swift": 0,
  "opentelemetry/android": 0,
  "opentelemetry/webjs": 0,
  "otlp/cpp": 0,
  "otlp/dotnet": 0,
  "otlp/erlang": 0,
  "otlp/go": 0,
  "otlp/java": 0,
  "otlp/nodejs": 0,
  "otlp/php": 0,
  "otlp/python": 0,
  "otlp/ruby": 0,
  "otlp/rust": 0,
  "otlp/swift": 0,
  "otlp/android": 0,
  "otlp/webjs": 0,
  "ios/swift": 0
}
```
</details>
<details>
<summary>`Agents` task old output:</summary>

```json
{
  "dotnet": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.19.0+f72bf10e024b0bad4601ccda7fdea7db46c71640"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "ASP.NET Core"
        ],
        "version": [
          "3.1.7.0"
        ],
        "composite": [
          "ASP.NET Core/3.1.7.0"
        ]
      },
      "language": {
        "name": [
          "C#"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "AWS_lambda",
          ".NET Core"
        ],
        "version": [
          "3.1.7"
        ],
        "composite": [
          ".NET Core/3.1.7"
        ]
      }
    }
  },
  "go": {
    "agent": {
      "activation_method": [],
      "version": [
        "2.6.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "gin"
        ],
        "version": [
          "v1.10.0"
        ],
        "composite": [
          "gin/v1.10.0"
        ]
      },
      "language": {
        "name": [
          "go"
        ],
        "version": [
          "go1.22.7",
          "go1.18.3"
        ],
        "composite": [
          "go/go1.22.7",
          "go/go1.18.3"
        ]
      },
      "runtime": {
        "name": [
          "gc"
        ],
        "version": [
          "go1.22.7",
          "go1.18.3"
        ],
        "composite": [
          "gc/go1.22.7",
          "gc/go1.18.3"
        ]
      }
    }
  },
  "iOS/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [
          "iOS"
        ],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "java"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "iOS"
        ],
        "version": [
          "13",
          "9",
          "11"
        ],
        "composite": [
          "iOS/13",
          "iOS/9",
          "iOS/11"
        ]
      }
    }
  },
  "java": {
    "agent": {
      "activation_method": [
        "k8s-attach"
      ],
      "version": [
        "1.38.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "Spring Web MVC",
          "Servlet API"
        ],
        "version": [
          "6.1.11"
        ],
        "composite": [
          "Spring Web MVC/6.1.11"
        ]
      },
      "language": {
        "name": [
          "Java"
        ],
        "version": [
          "17.0.12"
        ],
        "composite": [
          "Java/17.0.12"
        ]
      },
      "runtime": {
        "name": [
          "Java"
        ],
        "version": [
          "17.0.12"
        ],
        "composite": [
          "Java/17.0.12"
        ]
      }
    }
  },
  "js-base": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "nodejs": {
    "agent": {
      "activation_method": [
        "env-attach",
        "require"
      ],
      "version": [
        "3.46.0",
        "4.7.2"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "express"
        ],
        "version": [
          "4.19.2",
          "4.18.2"
        ],
        "composite": [
          "express/4.19.2",
          "express/4.18.2"
        ]
      },
      "language": {
        "name": [
          "javascript"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "AWS_lambda",
          "node"
        ],
        "version": [
          "18.13.0",
          "22.5.1"
        ],
        "composite": [
          "node/18.13.0",
          "node/22.5.1"
        ]
      }
    }
  },
  "php": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.8.4"
      ]
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "PHP"
        ],
        "version": [
          "8.0.30"
        ],
        "composite": [
          "PHP/8.0.30"
        ]
      },
      "runtime": {
        "name": [
          "PHP"
        ],
        "version": [
          "8.0.30"
        ],
        "composite": [
          "PHP/8.0.30"
        ]
      }
    }
  },
  "python": {
    "agent": {
      "activation_method": [
        "unknown"
      ],
      "version": [
        "6.22.3"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "django"
        ],
        "version": [
          "5.0.7"
        ],
        "composite": [
          "django/5.0.7"
        ]
      },
      "language": {
        "name": [
          "python"
        ],
        "version": [
          "3.12.4"
        ],
        "composite": [
          "python/3.12.4"
        ]
      },
      "runtime": {
        "name": [
          "AWS_lambda",
          "CPython"
        ],
        "version": [
          "3.12.4"
        ],
        "composite": [
          "CPython/3.12.4"
        ]
      }
    }
  },
  "ruby": {
    "agent": {
      "activation_method": [],
      "version": [
        "4.7.3"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "Ruby on Rails"
        ],
        "version": [
          "6.1.4.1"
        ],
        "composite": [
          "Ruby on Rails/6.1.4.1"
        ]
      },
      "language": {
        "name": [
          "ruby"
        ],
        "version": [
          "2.7.3"
        ],
        "composite": [
          "ruby/2.7.3"
        ]
      },
      "runtime": {
        "name": [
          "ruby"
        ],
        "version": [
          "2.7.3"
        ],
        "composite": [
          "ruby/2.7.3"
        ]
      }
    }
  },
  "rum-js": {
    "agent": {
      "activation_method": [],
      "version": [
        "5.16.0"
      ]
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "javascript"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "android/java": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [
          "Android Activity"
        ],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "java"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "Android Runtime"
        ],
        "version": [
          "2.1.0",
          "1.9.0",
          "2.0.0"
        ],
        "composite": [
          "Android Runtime/2.1.0",
          "Android Runtime/1.9.0",
          "Android Runtime/2.0.0"
        ]
      }
    }
  },
  "otlp": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/cpp": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/dotnet": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.4.0.802"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "OpenTelemetry.Instrumentation.Runtime"
        ],
        "version": [
          "1.1.0.2"
        ],
        "composite": [
          "OpenTelemetry.Instrumentation.Runtime/1.1.0.2"
        ]
      },
      "language": {
        "name": [
          "dotnet"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/erlang": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.2.1"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "opentelemetry_ecto",
          "opentelemetry_phoenix"
        ],
        "version": [
          "1.0.0"
        ],
        "composite": [
          "opentelemetry_ecto/1.0.0",
          "opentelemetry_phoenix/1.0.0"
        ]
      },
      "language": {
        "name": [
          "erlang"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "BEAM"
        ],
        "version": [
          "11.2.2.8"
        ],
        "composite": [
          "BEAM/11.2.2.8"
        ]
      }
    }
  },
  "opentelemetry/go": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.10.0",
        "1.11.2"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "go.opentelemetry.io/contrib/instrumentation/runtime"
        ],
        "version": [
          "semver:0.36.1",
          "semver:0.36.4"
        ],
        "composite": [
          "go.opentelemetry.io/contrib/instrumentation/runtime/semver:0.36.4",
          "go.opentelemetry.io/contrib/instrumentation/runtime/semver:0.36.1"
        ]
      },
      "language": {
        "name": [
          "go"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "go"
        ],
        "version": [
          "go1.19.2",
          "go1.19.4"
        ],
        "composite": [
          "go/go1.19.4",
          "go/go1.19.2"
        ]
      }
    }
  },
  "opentelemetry/java": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.10.1",
        "1.23.1",
        "1.24.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "io.opentelemetry.tomcat-10.0",
          "io.opentelemetry.jdbc",
          "io.opentelemetry.spring-data-1.8"
        ],
        "version": [
          "1.10.1",
          "1.23.0-alpha",
          "1.24.0-alpha"
        ],
        "composite": [
          "io.opentelemetry.tomcat-10.0/1.10.1",
          "io.opentelemetry.jdbc/1.10.1",
          "io.opentelemetry.spring-data-1.8/1.10.1"
        ]
      },
      "language": {
        "name": [
          "java"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "OpenJDK Runtime Environment"
        ],
        "version": [
          "17.0.12+7",
          "11.0.18+10-LTS",
          "17.0.6+10-Debian-1deb11u1"
        ],
        "composite": [
          "OpenJDK Runtime Environment/17.0.12+7",
          "OpenJDK Runtime Environment/11.0.18+10-LTS",
          "OpenJDK Runtime Environment/17.0.6+10-Debian-1deb11u1"
        ]
      }
    }
  },
  "opentelemetry/nodejs": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.10.1",
        "1.9.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "@opentelemetry/instrumentation-fs",
          "@opentelemetry/instrumentation-http",
          "@opentelemetry/instrumentation-net"
        ],
        "version": [
          "0.7.1",
          "0.6.0",
          "0.35.1"
        ],
        "composite": [
          "@opentelemetry/instrumentation-fs/0.7.1",
          "@opentelemetry/instrumentation-fs/0.6.0",
          "@opentelemetry/instrumentation-http/0.35.1"
        ]
      },
      "language": {
        "name": [
          "nodejs"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "nodejs"
        ],
        "version": [
          "18.16.0",
          "16.20.0"
        ],
        "composite": [
          "nodejs/18.16.0",
          "nodejs/16.20.0"
        ]
      }
    }
  },
  "opentelemetry/php": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/python": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.15.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "opentelemetry.instrumentation.system_metrics"
        ],
        "version": [
          "0.36b0"
        ],
        "composite": [
          "opentelemetry.instrumentation.system_metrics/0.36b0"
        ]
      },
      "language": {
        "name": [
          "python"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/ruby": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/rust": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/android": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/webjs": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/cpp": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/dotnet": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/erlang": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/go": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/java": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/nodejs": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/php": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/python": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/ruby": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/rust": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/android": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/webjs": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "ios/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  }
}
```
</details>
<details>
<summary>`Agents` task new output:</summary>

```json
{
  "dotnet": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.19.0+f72bf10e024b0bad4601ccda7fdea7db46c71640"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "ASP.NET Core"
        ],
        "version": [
          "3.1.7.0"
        ],
        "composite": [
          "ASP.NET Core/3.1.7.0"
        ]
      },
      "language": {
        "name": [
          "C#"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "AWS_lambda",
          ".NET Core"
        ],
        "version": [
          "3.1.7"
        ],
        "composite": [
          ".NET Core/3.1.7"
        ]
      }
    }
  },
  "go": {
    "agent": {
      "activation_method": [],
      "version": [
        "2.6.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "gin"
        ],
        "version": [
          "v1.10.0"
        ],
        "composite": [
          "gin/v1.10.0"
        ]
      },
      "language": {
        "name": [
          "go"
        ],
        "version": [
          "go1.22.7",
          "go1.18.3"
        ],
        "composite": [
          "go/go1.22.7",
          "go/go1.18.3"
        ]
      },
      "runtime": {
        "name": [
          "gc"
        ],
        "version": [
          "go1.22.7",
          "go1.18.3"
        ],
        "composite": [
          "gc/go1.22.7",
          "gc/go1.18.3"
        ]
      }
    }
  },
  "iOS/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [
          "iOS"
        ],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "java"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "iOS"
        ],
        "version": [
          "13",
          "9",
          "11"
        ],
        "composite": [
          "iOS/13",
          "iOS/9",
          "iOS/11"
        ]
      }
    }
  },
  "java": {
    "agent": {
      "activation_method": [
        "k8s-attach"
      ],
      "version": [
        "1.38.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "Spring Web MVC",
          "Servlet API"
        ],
        "version": [
          "6.1.11"
        ],
        "composite": [
          "Spring Web MVC/6.1.11"
        ]
      },
      "language": {
        "name": [
          "Java"
        ],
        "version": [
          "17.0.12"
        ],
        "composite": [
          "Java/17.0.12"
        ]
      },
      "runtime": {
        "name": [
          "Java"
        ],
        "version": [
          "17.0.12"
        ],
        "composite": [
          "Java/17.0.12"
        ]
      }
    }
  },
  "js-base": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "nodejs": {
    "agent": {
      "activation_method": [
        "env-attach",
        "require"
      ],
      "version": [
        "3.46.0",
        "4.7.2"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "express"
        ],
        "version": [
          "4.19.2",
          "4.18.2"
        ],
        "composite": [
          "express/4.19.2",
          "express/4.18.2"
        ]
      },
      "language": {
        "name": [
          "javascript"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "AWS_lambda",
          "node"
        ],
        "version": [
          "18.13.0",
          "22.5.1"
        ],
        "composite": [
          "node/18.13.0",
          "node/22.5.1"
        ]
      }
    }
  },
  "php": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.8.4"
      ]
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "PHP"
        ],
        "version": [
          "8.0.30"
        ],
        "composite": [
          "PHP/8.0.30"
        ]
      },
      "runtime": {
        "name": [
          "PHP"
        ],
        "version": [
          "8.0.30"
        ],
        "composite": [
          "PHP/8.0.30"
        ]
      }
    }
  },
  "python": {
    "agent": {
      "activation_method": [
        "unknown"
      ],
      "version": [
        "6.22.3"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "django"
        ],
        "version": [
          "5.0.7"
        ],
        "composite": [
          "django/5.0.7"
        ]
      },
      "language": {
        "name": [
          "python"
        ],
        "version": [
          "3.12.4"
        ],
        "composite": [
          "python/3.12.4"
        ]
      },
      "runtime": {
        "name": [
          "AWS_lambda",
          "CPython"
        ],
        "version": [
          "3.12.4"
        ],
        "composite": [
          "CPython/3.12.4"
        ]
      }
    }
  },
  "ruby": {
    "agent": {
      "activation_method": [],
      "version": [
        "4.7.3"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "Ruby on Rails"
        ],
        "version": [
          "6.1.4.1"
        ],
        "composite": [
          "Ruby on Rails/6.1.4.1"
        ]
      },
      "language": {
        "name": [
          "ruby"
        ],
        "version": [
          "2.7.3"
        ],
        "composite": [
          "ruby/2.7.3"
        ]
      },
      "runtime": {
        "name": [
          "ruby"
        ],
        "version": [
          "2.7.3"
        ],
        "composite": [
          "ruby/2.7.3"
        ]
      }
    }
  },
  "rum-js": {
    "agent": {
      "activation_method": [],
      "version": [
        "5.16.0"
      ]
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "javascript"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "android/java": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [
          "Android Activity"
        ],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [
          "java"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "Android Runtime"
        ],
        "version": [
          "2.1.0",
          "1.9.0",
          "2.0.0"
        ],
        "composite": [
          "Android Runtime/2.1.0",
          "Android Runtime/1.9.0",
          "Android Runtime/2.0.0"
        ]
      }
    }
  },
  "ios/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/cpp": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/dotnet": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.4.0.802"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "OpenTelemetry.Instrumentation.Runtime"
        ],
        "version": [
          "1.1.0.2"
        ],
        "composite": [
          "OpenTelemetry.Instrumentation.Runtime/1.1.0.2"
        ]
      },
      "language": {
        "name": [
          "dotnet"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/erlang": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.2.1"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "opentelemetry_ecto",
          "opentelemetry_phoenix"
        ],
        "version": [
          "1.0.0"
        ],
        "composite": [
          "opentelemetry_ecto/1.0.0",
          "opentelemetry_phoenix/1.0.0"
        ]
      },
      "language": {
        "name": [
          "erlang"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "BEAM"
        ],
        "version": [
          "11.2.2.8"
        ],
        "composite": [
          "BEAM/11.2.2.8"
        ]
      }
    }
  },
  "opentelemetry/go": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.10.0",
        "1.11.2"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "go.opentelemetry.io/contrib/instrumentation/runtime"
        ],
        "version": [
          "semver:0.36.1",
          "semver:0.36.4"
        ],
        "composite": [
          "go.opentelemetry.io/contrib/instrumentation/runtime/semver:0.36.4",
          "go.opentelemetry.io/contrib/instrumentation/runtime/semver:0.36.1"
        ]
      },
      "language": {
        "name": [
          "go"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "go"
        ],
        "version": [
          "go1.19.2",
          "go1.19.4"
        ],
        "composite": [
          "go/go1.19.4",
          "go/go1.19.2"
        ]
      }
    }
  },
  "opentelemetry/java": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.10.1",
        "1.23.1",
        "1.24.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "io.opentelemetry.tomcat-10.0",
          "io.opentelemetry.jdbc",
          "io.opentelemetry.spring-data-1.8"
        ],
        "version": [
          "1.10.1",
          "1.23.0-alpha",
          "1.24.0-alpha"
        ],
        "composite": [
          "io.opentelemetry.tomcat-10.0/1.10.1",
          "io.opentelemetry.jdbc/1.10.1",
          "io.opentelemetry.spring-data-1.8/1.10.1"
        ]
      },
      "language": {
        "name": [
          "java"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "OpenJDK Runtime Environment"
        ],
        "version": [
          "17.0.12+7",
          "11.0.18+10-LTS",
          "17.0.6+10-Debian-1deb11u1"
        ],
        "composite": [
          "OpenJDK Runtime Environment/17.0.12+7",
          "OpenJDK Runtime Environment/11.0.18+10-LTS",
          "OpenJDK Runtime Environment/17.0.6+10-Debian-1deb11u1"
        ]
      }
    }
  },
  "opentelemetry/nodejs": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.10.1",
        "1.9.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "@opentelemetry/instrumentation-fs",
          "@opentelemetry/instrumentation-http",
          "@opentelemetry/instrumentation-net"
        ],
        "version": [
          "0.7.1",
          "0.6.0",
          "0.35.1"
        ],
        "composite": [
          "@opentelemetry/instrumentation-fs/0.7.1",
          "@opentelemetry/instrumentation-fs/0.6.0",
          "@opentelemetry/instrumentation-http/0.35.1"
        ]
      },
      "language": {
        "name": [
          "nodejs"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [
          "nodejs"
        ],
        "version": [
          "18.16.0",
          "16.20.0"
        ],
        "composite": [
          "nodejs/18.16.0",
          "nodejs/16.20.0"
        ]
      }
    }
  },
  "opentelemetry/php": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/python": {
    "agent": {
      "activation_method": [],
      "version": [
        "1.15.0"
      ]
    },
    "service": {
      "framework": {
        "name": [
          "opentelemetry.instrumentation.system_metrics"
        ],
        "version": [
          "0.36b0"
        ],
        "composite": [
          "opentelemetry.instrumentation.system_metrics/0.36b0"
        ]
      },
      "language": {
        "name": [
          "python"
        ],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/ruby": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/rust": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/android": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "opentelemetry/webjs": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/cpp": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/dotnet": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/erlang": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/go": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/java": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/nodejs": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/php": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/python": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/ruby": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/rust": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/swift": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/android": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  },
  "otlp/webjs": {
    "agent": {
      "activation_method": [],
      "version": []
    },
    "service": {
      "framework": {
        "name": [],
        "version": [],
        "composite": []
      },
      "language": {
        "name": [],
        "version": [],
        "composite": []
      },
      "runtime": {
        "name": [],
        "version": [],
        "composite": []
      }
    }
  }
}
```
</details>

---------

Co-authored-by: Alejandro Fernández Haro <[email protected]>
(cherry picked from commit 70d1597)
miloszmarcinkowski added a commit that referenced this pull request Oct 16, 2024
…6522)

## Summary

Manually cherry-picked #195594 due to backport script failed because of
collapsible section in original PR description.
@miloszmarcinkowski
Copy link
Contributor Author

miloszmarcinkowski commented Oct 16, 2024

Manually cherry-picked and merged into 8.x branch (future 8.16) in #196522

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:opentelemetry APM UI - OTEL Work apm backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) ci:project-deploy-observability Create an Observability project release_note:fix Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[APM][OTel] Make agent names generic with otel-native mode
8 participants