[Feature] OpenTelemetry GenAI exporter for Agent Traces (Phase 1: Java, spans-only)
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- java
- Domain
- observability-sre
Research direction
Start by reading the serialized JSON Event Log contract in #924 and the existing trace_tree.py diagnostic shape. Define the standalone Java converter around the issue's span, ID, grouping, and incomplete-execution rules, then verify that repeated exports are deterministic and malformed records produce the specified diagnostics.
Written by the indexing model from the issue text.
Description
Search before asking
- I searched in the [issues](https://github.com/apache/flink-agents/issues) and found nothing similar.
Description
Tracking issue for Phase 1 of the OTel exporter discussed in #929, as a follow-up to #900 and the Execution Event recording work in #924.
Scope (Phase 1):
- A batch, offline converter over already-collected Event Log files (
event-log.trace.enabled: true). It maps Execution Events to OpenTelemetry GenAI spans: oneinputRunIdbecomes one trace with a synthesizedinvoke_agentroot, and the recorded execution hierarchy defines the rest of the span tree. Records are grouped byinputRunId, sorted by timestamp, and end-of-input marks completion. - Span mapping follows #929:
llmuses CLIENT;tool,action,parser, and the run root use INTERNAL.parsermaps toparse {name}withgen_ai.operation.name: "parse". - Incomplete executions are still exported rather than dropped. A start without a terminal becomes a zero-duration span with status UNSET and
flink_agents.execution.incomplete = true, plus anINCOMPLETE_EXECUTIONdiagnostic. The inverse case usesMISSING_START. - Diagnostics follow the existing
trace_tree.pyshape (code, id, message, file location), includingMALFORMED_RECORDfor invalid input. - The input contract is the serialized JSON Event Log record, not a particular file name. Explicit files are read as-is, unknown fields are ignored, and directory inputs may discover
events-*.logfiles for convenience. For multi-subtask jobs, completeness of the supplied file set remains the caller's responsibility. - Framework IDs are deterministically mapped to fixed-width OTel trace/span IDs so repeated exports produce the same IDs. Delivery remains at-least-once.
- Configuration is provided through converter arguments such as endpoint, protocol, and
service.name. Content capture is excluded from Phase 1. - Delivered as an optional standalone module, not bundled into dist, with OTel dependencies aligned through the
opentelemetry-bom. - Because the serialized Event Log format is shared across runtimes, the same converter works for both Java and Python agents.
Out of scope, tracked separately:
- A durable/replayable Event Log sink and a continuous OTel consumer with checkpoint/replay semantics.
- Content capture and richer usage metadata, pending the
entityMetadatawork discussed in #929 / #924. - Optional OpenInference classification (
openinference.span.kind) for backends such as Phoenix/Langfuse.
Rejected alternative (Flink's native OpenTelemetryTraceReporterFactory): see the note in #929.
Depends on #924 (recording contract).
Are you willing to submit a PR?
- I'm willing to submit a PR!
- Dominant language
- Java
- Stars
- 454
- Forks
- 167
- Avg merge
- 5d 1h
- Merged PRs (30d)
- 46
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/flink-agents
-
apache/flink-agents#1145 · 1 assignee ·
-
feature priority/major
Difficulty 5/5 Over a week Newbie friendliness 35/100
apache/flink-agents#1141 ·
-
feature priority/major
Difficulty 5/5 Over a week Newbie friendliness 25/100
apache/flink-agents#1140 ·
-
feature priority/major
Difficulty 5/5 Over a week Newbie friendliness 25/100
apache/flink-agents#1139 ·
-
feature priority/major
apache/flink-agents#1137 · 1 assignee ·
All issues in apache/flink-agents
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100