elastic/observability-edot-java-instrument

Instrumenter une application Java avec la distribution Elastic d'OpenTelemetry (EDOT) Java agent pour le tracing automatique, les métriques et les logs. À utiliser pour ajouter de l'observabilité à un service Java sans agent APM existant.

Qu'est-ce que observability-edot-java-instrument ?

Cette compétence permet d'instrumenter automatiquement une application Java avec l'agent Elastic Distribution of OpenTelemetry (EDOT) Java, afin de collecter traces, métriques et logs sans modification du code source. Elle est conçue pour les développeurs et ingénieurs DevOps souhaitant ajouter de l'observabilité à des services Java existants qui ne disposent pas encore d'agent APM. La compétence supporte l'exécution via des assistants IA comme Claude Code, Cursor ou Codex, et automatise l'attachement de l'agent EDOT au démarrage de l'application (par exemple en ajoutant le flag `-javaagent` ou en configurant la variable d'environnement `OTEL_JAVAAGENT_ENABLED`). L'utilisateur n'a qu'à préciser le chemin vers le fichier JAR de l'agent ou une version à télécharger, et le reste de la configuration est géré automatiquement pour envoyer les données vers Elastic.

Compatible avec~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/elastic/agent-skills/tree/main/skills/observability-edot-java-instrument

Installed? Explore more Productivité et collaboration skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

Demander à votre IA préférée

Ouvre une nouvelle conversation avec cette compétence d'agent déjà préchargée.

Documentation

Que fait observability-edot-java-instrument ?

Instrumenter une application Java avec la distribution Elastic d'OpenTelemetry (EDOT) Java agent pour le tracing automatique, les métriques et les logs. À utiliser pour ajouter de l'observabilité à un service Java qui ne dispose d'aucun agent APM existant.

Aperçu

Cette compétence automatise l'instrumentation d'applications Java à l'aide de l'agent EDOT Java d'Elastic. En attachant l'agent au runtime Java, vous obtenez une observabilité prête à l'emploi sans modification du code source :

  • Tracing – capture automatique des spans pour les frameworks et bibliothèques courants (Spring Boot, JAX-RS, JDBC, etc.)
  • Métriques – collecte de métriques runtime (JVM, CPU, mémoire) et applicatives
  • Logs – corrélation des logs avec les traces via l'injection automatique d'ID de trace

Prérequis

  • Application Java existante (JDK 11+ recommandé)
  • Accès en écriture au répertoire de l'application pour télécharger l'agent
  • Connexion réseau vers votre cluster Elastic (Elasticsearch, Kibana, APM Server)

Utilisation

  1. Téléchargez la dernière version de l'agent EDOT Java au format JAR.
  2. Ajoutez le flag JVM suivant lors du démarrage de l'application :
-javaagent:/path/to/elastic-otel-javaagent.jar
  1. Configurez les variables d'environnement pour pointer vers votre backend Elastic :
export OTEL_EXPORTER_OTLP_ENDPOINT="https://votre-cluster.apm.europe-west1.gcp.cloud.es.io"
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer votre_api_key"
export OTEL_SERVICE_NAME="nom-de-votre-service"
  1. Redémarrez l'application. Les données commenceront à apparaître dans Kibana/APM.

Exemple avec Docker

Pour une application conteneurisée, ajoutez ce qui suit à votre Dockerfile :

COPY --from=elastic/otel-agent:latest /elastic-otel-javaagent.jar /opt/agent/
ENV JAVA_TOOL_OPTIONS="-javaagent:/opt/agent/elastic-otel-javaagent.jar"
ENV OTEL_EXPORTER_OTLP_ENDPOINT="https://votre-cluster.apm.europe-west1.gcp.cloud.es.io"
ENV OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer votre_api_key"
ENV OTEL_SERVICE_NAME="nom-de-votre-service"

Configuration avancée

Reportez-vous à la documentation officielle pour configurer des options supplémentaires comme les filtres de spans, la personnalisation du sampling ou l'export vers plusieurs destinations.

Dépannage

  • Vérifiez que l'agent JAR est accessible en lecture au démarrage de la JVM.
  • Assurez-vous que l'endpoint OTLP est correct et accessible depuis l'application.
  • Consultez les logs de l'application pour détecter d'éventuelles erreurs liées à l'agent.

Support

Pour toute question, ouvrez une issue sur le dépôt GitHub ou contactez le support Elastic.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

elastic/cloud-access-management

Manage Elastic Cloud organization access: invite users, assign roles to Serverless projects, and create or revoke Cloud API keys. Use when granting, modifying, or auditing user access.

elastic/cloud-create-project

Creates Elastic Cloud Serverless projects (Elasticsearch, Observability, or Security) via the REST API, saves credentials to file, and bootstraps a scoped Elasticsearch API key. Use when creating a new serverless project, provisioning a search or observability environment, or spinning up a new Elastic Cloud project.

elastic/cloud-manage-project

Manages existing Elastic Cloud Serverless projects: list, get, update, delete, reset credentials, resume, and load saved credentials. Connects to existing projects by resolving endpoints and acquiring scoped Elasticsearch API keys. Use when performing day-2 operations on serverless projects, connecting to an existing project, loading or resetting project credentials, or looking up project details.

elastic/cloud-network-security

Manage Serverless network security (traffic filters): create, update, and delete IP filters and AWS PrivateLink VPC filters. Use when restricting network access or configuring private connectivity.

elastic/cloud-setup

Configures Elastic Cloud authentication and environment defaults. Use when setting up EC_API_KEY, configuring Cloud API access, or when another cloud skill requires credentials.

elastic/elasticsearch-audit

Enable, configure, and query Elasticsearch security audit logs. Use when the task involves audit logging setup, event filtering, or investigating security incidents like failed logins.

elastic/elasticsearch-authn

Authenticate to Elasticsearch using native, file-based, LDAP/AD, SAML, OIDC, Kerberos, JWT, or certificate realms. Use when connecting with credentials, choosing a realm, or managing API keys. Assumes the target realms are already configured.

elastic/elasticsearch-authz

Manage Elasticsearch RBAC: native users, roles, role mappings, document- and field-level security. Use when creating users or roles, assigning privileges, or mapping external realms like LDAP/SAML.

elastic/elasticsearch-esql

Execute ES|QL (Elasticsearch Query Language) queries, use when the user wants to query Elasticsearch data, analyze logs, aggregate metrics, explore data, or create charts and dashboards from ES|QL results.

elastic/elasticsearch-file-ingest

Ingest and transform data files (CSV/JSON/Parquet/Arrow IPC) into Elasticsearch with stream processing and custom transforms. Use when loading files or batch importing data — not for reindexing, general ingest pipeline design, or bulk API patterns.

elastic/elasticsearch-onboarding

Help developers new to Elasticsearch get from zero to a working search experience. Guide them through understanding their intent, mapping their data, and building a search experience with best practices baked in. Use this when the user shows intent to build search-related functionality, asks about Elasticsearch-related concepts for their use case, or expresses the need for help getting started with Elasticsearch.

elastic/elasticsearch-security-troubleshooting

Diagnose and resolve Elasticsearch security errors: 401/403 failures, TLS problems, expired API keys, role mapping mismatches, and Kibana login issues. Use when the user reports a security error.

elastic/kibana-agent-builder

Create and manage Agent Builder agents and custom tools in Kibana. Use when asked to create, update, delete, test, or inspect agents or tools in Agent Builder.

elastic/kibana-alerting-rules

Create and manage Kibana alerting rules via REST API or Terraform. Use when creating, updating, or managing rule lifecycle (enable, disable, mute, snooze) or rules-as-code workflows.

elastic/kibana-audit

Enable and configure Kibana audit logging for saved object access, logins, and space operations. Use when setting up Kibana audit, filtering events, or correlating Kibana and ES audit logs.

elastic/kibana-connectors

Create and manage Kibana connectors for Slack, PagerDuty, Jira, webhooks, and more via REST API or Terraform. Use when configuring third-party integrations or managing connectors as code.

elastic/kibana-dashboards

Create and manage Kibana Dashboards and visualizations. Use when you need to define dashboards and visualizations declaratively, version control them, or automate their deployment.

elastic/kibana-streams

List, inspect, enable, disable, and resync Kibana Streams via the REST API. Use when the user needs stream details, ingest/query settings, queries, significant events, or attachments.

elastic/kibana-vega

Create Vega and Vega-Lite visualizations with ES|QL data sources in Kibana. Use when building custom charts, dashboards, or programmatic panel layouts beyond standard Lens charts.

elastic/observability-edot-dotnet-instrument

Instrument a .NET application with the Elastic Distribution of OpenTelemetry (EDOT) .NET SDK for automatic tracing, metrics, and logs. Use when adding observability to a .NET service that has no existing APM agent.

Skills associés