open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.02k stars 2.33k forks source link

[exporter/elasticsearch] Elasticsearch Exporter Not Exporting Span Events #18479

Closed Descartes1981 closed 1 year ago

Descartes1981 commented 1 year ago

Component(s)

exporter/elasticsearch

What happened?

The exported span record doesn't contain: span events informaton:

C# emitting code:

        [HttpGet]
        [Route("Random")]
        public IEnumerable<int> Get([FromQuery] int count)
        {
            using var span = _tracer.StartActiveSpan("GetRandoms");

            span.AddEvent("**Generating Random Numbers**", ->missing
                new SpanAttributes(new Dictionary<string, object> { { "Count", count } }));

            var randoms = Enumerable.Range(1, count).Select(_ => Random.Next(1, 100)).ToArray();

            span.AddEvent("Random Numbers Were Generated", ->missing
                new SpanAttributes(new Dictionary<string, object>
                    { { "Count", count }, { "Numbers", string.Join(",", randoms) } }));

            span.SetStatus(Status.Ok);

            return randoms;
        }
{
    "_index": "otel_trace_index",
    "_id": "AdJ-NIYBXAUPn3c51_CD",
    "_version": 1,
    "_seq_no": 6,
    "_primary_term": 1,
    "found": true,
    "_source": {
        "@timestamp": "2023-02-09T04:45:53.221066600Z",
        "EndTimestamp": "2023-02-09T04:45:53.221324100Z",
        "Kind": "SPAN_KIND_INTERNAL",
        "Link": "[]",
        "Name": "GetRandoms",
        "ParentSpanId": "6bd3ad5ac67e7db8",
        "Resource.service.instance.id": "064dd191-d7ee-4b12-abe8-60593845c149",
        "Resource.service.name": "RootService",
        "SpanId": "b048c67526d65cea",
        "TraceId": "5dfff6df3a0cdaf0e34637c0ab64f918",
        "TraceStatus": 1
    }
}

Collector version

v0.70.0

Environment information

No response

OpenTelemetry Collector configuration

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: '0.0.0.0:4317'
      http:
        endpoint: '0.0.0.0:4318'
        cors:
          allowed_origins:
            - 'http://*'
            - 'https://*'

processors:
  batch:
    send_batch_size: 1000
    timeout: 1s
  memory_limiter:
    limit_mib: 1500
    spike_limit_mib: 512
    check_interval: 5s

extensions:
  health_check:
  pprof:
  zpages:

exporters:
  elasticsearch/trace:
    endpoints: [http://es-container:9200]
    traces_index: otel_trace_index
  elasticsearch/log:
    endpoints: [http://es-container:9200]
    logs_index: otel_log_index

service:
  extensions: [pprof, zpages, health_check]
  pipelines:
    traces:
      receivers:
        - otlp
      processors:
        - memory_limiter
        - batch
      exporters:
        - elasticsearch/trace
    logs:
      receivers:
        - otlp
      processors:
        - memory_limiter
        - batch
      exporters:
        - elasticsearch/log

Log output

N/A

Additional context

N/A

github-actions[bot] commented 1 year ago

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

JaredTan95 commented 1 year ago

thx, @Descartes1981 I will handle this soon.

github-actions[bot] commented 1 year ago

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.