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

[exporter/elasticsearch] Bulk indexer error: an id must be provided if version type or value are set #33139

Open
lmssy opened this issue May 21, 2024 · 2 comments
Labels
bug Something isn't working exporter/elasticsearch needs triage New item requiring triage

Comments

@lmssy
Copy link

lmssy commented May 21, 2024

Component(s)

exporter/elasticsearch

What happened?

Description

I'm trying to export trace & span to elasticsearch v7, I config collector just follow the document https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/elasticsearchexporter
but in collector's log report below error, there is no index created in elasticsearch. please help to check, thx.

image

Steps to Reproduce

Expected Result

Actual Result

Collector version

0.100.0

Environment information

Environment

OpenTelemetry Collector configuration

extensions:
  health_check:
receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318
exporters:
  file:
    path: /agent.json
  debug:
  elasticsearch/trace:
    endpoints: [http:https://my-elastich-host:9200]
    traces_index: trace_index
    user: xxx
    password: xxx
processors:
  batch/trace:
  memory_limiter/trace:
    limit_mib: 3000
    spike_limit_mib: 600
    check_interval: 5s
  tail_sampling:
    decision_wait: 10s
    policies:
      - name: slow_calls
        type: latency
        latency:
          threshold_ms: 5000
      - name: error_otel_status
        type: status_code
        status_code:
          status_codes:
            - ERROR
      - name: error_http_status
        type: numeric_attribute
        numeric_attribute:
            key: http.status_code
            min_value: 500
      - name: keep_sampled_success
        type: and
        and:
          and_sub_policy:
            - name: drop_noisy_traces_url
              type: string_attribute
              string_attribute:
                key: http.url
                values:
                  - \/metrics
                  - opentelemetry\.proto
                  - favicon\.ico
                  - \/health
                enabled_regex_matching: true
                invert_match: true
            - name: keep_percentage
              type: probabilistic
              probabilistic:
                sampling_percentage: 100
service:
  extensions: [health_check]
  pipelines:
    traces:
      receivers: [otlp]
      processors: [memory_limiter/trace,tail_sampling,batch/trace]
      exporters: [debug,file,elasticsearch/trace]

Log output

2024-05-21T13:48:18.897+0800	error	[email protected]/elasticsearch_bulk.go:150	Bulk indexer error: flush: [400 Bad Request] {"error":{"root_cause":[{"type":"action_request_validation_exception","reason":"Validation Failed: 1: an id must be provided if version type or value are set;2: an id must be provided if version type or value are set;"}],"type":"action_request_validation_exception","reason":"Validation Failed: 1: an id must be provided if version type or value are set;2: an id must be provided if version type or value are set;"},"status":400}	{"kind": "exporter", "data_type": "traces", "name": "elasticsearch/trace"}
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter.newBulkIndexer.func1
	github.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/elasticsearch_bulk.go:150
github.com/elastic/go-elasticsearch/v7/esutil.(*bulkIndexer).init.func1
	github.com/elastic/go-elasticsearch/[email protected]/esutil/bulk_indexer.go:324
2024-05-21T13:48:18.907+0800	error	[email protected]/elasticsearch_bulk.go:150	Bulk indexer error: flush: [400 Bad Request] {"error":{"root_cause":[{"type":"action_request_validation_exception","reason":"Validation Failed: 1: an id must be provided if version type or value are set;2: an id must be provided if version type or value are set;"}],"type":"action_request_validation_exception","reason":"Validation Failed: 1: an id must be provided if version type or value are set;2: an id must be provided if version type or value are set;"},"status":400}	{"kind": "exporter", "data_type": "traces", "name": "elasticsearch/trace"}
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter.newBulkIndexer.func1
	github.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/elasticsearch_bulk.go:150
github.com/elastic/go-elasticsearch/v7/esutil.(*worker).flush
	github.com/elastic/go-elasticsearch/[email protected]/esutil/bulk_indexer.go:568
github.com/elastic/go-elasticsearch/v7/esutil.(*bulkIndexer).init.func1
	github.com/elastic/go-elasticsearch/[email protected]/esutil/bulk_indexer.go:321
2024-05-21T13:48:18.907+0800	error	[email protected]/elasticsearch_bulk.go:150	Bulk indexer error: flush: [400 Bad Request] {"error":{"root_cause":[{"type":"action_request_validation_exception","reason":"Validation Failed: 1: an id must be provided if version type or value are set;2: an id must be provided if version type or value are set;"}],"type":"action_request_validation_exception","reason":"Validation Failed: 1: an id must be provided if version type or value are set;2: an id must be provided if version type or value are set;"},"status":400}	{"kind": "exporter", "data_type": "traces", "name": "elasticsearch/trace"}
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter.newBulkIndexer.func1
	github.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/elasticsearch_bulk.go:150
github.com/elastic/go-elasticsearch/v7/esutil.(*bulkIndexer).init.func1
	github.com/elastic/go-elasticsearch/[email protected]/esutil/bulk_indexer.go:324
2024-05-21T13:48:18.968+0800	error	[email protected]/elasticsearch_bulk.go:150	Bulk indexer error: flush: [400 Bad Request] {"error":{"root_cause":[{"type":"action_request_validation_exception","reason":"Validation Failed: 1: an id must be provided if version type or value are set;2: an id must be provided if version type or value are set;"}],"type":"action_request_validation_exception","reason":"Validation Failed: 1: an id must be provided if version type or value are set;2: an id must be provided if version type or value are set;"},"status":400}	{"kind": "exporter", "data_type": "traces", "name": "elasticsearch/trace"}
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter.newBulkIndexer.func1
	github.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/elasticsearch_bulk.go:150
github.com/elastic/go-elasticsearch/v7/esutil.(*worker).flush
	github.com/elastic/go-elasticsearch/[email protected]/esutil/bulk_indexer.go:568
github.com/elastic/go-elasticsearch/v7/esutil.(*bulkIndexer).init.func1
	github.com/elastic/go-elasticsearch/[email protected]/esutil/bulk_indexer.go:321
2024-05-21T13:48:18.968+0800	error	[email protected]/elasticsearch_bulk.go:150	Bulk indexer error: flush: [400 Bad Request] {"error":{"root_cause":[{"type":"action_request_validation_exception","reason":"Validation Failed: 1: an id must be provided if version type or value are set;2: an id must be provided if version type or value are set;"}],"type":"action_request_validation_exception","reason":"Validation Failed: 1: an id must be provided if version type or value are set;2: an id must be provided if version type or value are set;"},"status":400}	{"kind": "exporter", "data_type": "traces", "name": "elasticsearch/trace"}
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter.newBulkIndexer.func1
	github.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/elasticsearch_bulk.go:150
github.com/elastic/go-elasticsearch/v7/esutil.(*bulkIndexer).init.func1
	github.com/elastic/go-elasticsearch/[email protected]/esutil/bulk_indexer.go:324
2024-05-21T13:48:19.010+0800	info	TracesExporter	{"kind": "exporter", "data_type": "traces", "name": "debug", "resource spans": 1, "spans": 1}
2024-05-21T13:48:21.016+0800	info	TracesExporter	{"kind": "exporter", "data_type": "traces", "name": "debug", "resource spans": 2, "spans": 2}
2024-05-21T13:48:24.026+0800	info	TracesExporter	{"kind": "exporter", "data_type": "traces", "name": "debug", "resource spans": 1, "spans": 1}
2024-05-21T13:48:31.045+0800	info	TracesExporter	{"kind": "exporter", "data_type": "traces", "name": "debug", "resource spans": 1, "spans": 1}

Additional context

No response

@lmssy lmssy added bug Something isn't working needs triage New item requiring triage labels May 21, 2024
Copy link
Contributor

Pinging code owners:

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

@lmssy
Copy link
Author

lmssy commented May 29, 2024

anyone can take a look for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exporter/elasticsearch needs triage New item requiring triage
Projects
None yet
Development

No branches or pull requests

1 participant