Skip to content

hypertrace/javaagent

Repository files navigation

CircleCI

Hypertrace OpenTelemetry Java agent

Hypertrace distribution of OpenTelemetry Java agent.

This agent supports these frameworks and adds following capabilities:

  • capture request and response headers
  • capture request and response bodies
  • execution blocking based on Open Policy Agent

List of supported frameworks with additional capabilities:

Library/Framework Versions
Servlet 2.3+
Spark Web Framework 2.3+
gRPC 1.5+
OkHttp 3.0+

Build

make build

The final artifact is in javaagent/build/libs/hypertrace-agent-<version>-all.jar

Run & Configure

HT_EXPORTING_ADDRESS=http://localhost:9411/api/v2/spans java -javaagent:javaagent/build/libs/hypertrace-agent-<version>-all.jar -jar app.jar

By default the agent uses Zipkin exporter.

The configuration precedence order

  1. OpenTelemetry Agent's trace config file OTEL_TRACE_CONFIG/otel.trace.config
  2. OpenTelemetry system properties and env variables
  3. Hypertrace configuration with the following precedence order:
    1. system properties
    2. environment variables, TODO add link to agent-config repo
    3. configuration file, specified HT_CONFIG_FILE=example-config.yaml

Hypertrace body/headers capture can be disabled by:

  • HT_DATA_CAPTURE_HTTP_BODY_REQUEST - disables additional data capture for all instrumentations
  • HYPERTRACE_INTEGRATION_<integration>_ENABLED - disables capture for a specified instrumentation e.g. servlet, servlet-3

Test

Tests use docker via Testcontainers.org.

When running tests from IDE set SMOKETEST_JAVAAGENT_PATH env variable.

make test

About

Hypertrace OpenTelemetry Java agent with payload/body and headers data capture.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages