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/elasticsearchexporter]: Add dynamic index option for both logs and traces #16094

Merged
merged 19 commits into from
May 16, 2023

Conversation

leewoobin789
Copy link
Contributor

@leewoobin789 leewoobin789 commented Nov 7, 2022

Description:
The elasticsearchexporter of current version takes each one static index for both logs and traces. The capability of dynamic indexing based on attributes (logs_index_prefix, logs_index_suffix, traces_index_prefix, traces_index_suffix, elasticsearch.index.prefix, elasticsearch.index.suffix) will help users to delegate the final index.
Until now, what I have seen solar is the usage of ingestion pipeline dedicatedly for rewriting index, which is the only way to write data to multiple indexes.

This way, users have multiple options to route their data to a prefixed or suffixed index by using resource processor or attribute processor in sidecar collector/ main collector or even by adding it as static attribute in application instrumentation.

Link to tracking Issue:
#5854

Testing:
Test with test-purposed elastic search exporter with attributes defined above and check if the incoming bulk request has arrived in mock server with the expected prefixed&suffixed index.

Documentation:
Added in Readme

@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2022

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Dec 2, 2022
@MatheusGeiger
Copy link

Hello! I'm in need of this feature too, do we have a forecast of when the merge will take place?

@leewoobin789
Copy link
Contributor Author

@MatheusGeiger that is great to hear! I am still waiting for the code review.
@JaredTan95 FYI.

Copy link
Member

@JaredTan95 JaredTan95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx your contributions 👍
except for the above comments, other LGTM

exporter/elasticsearchexporter/README.md Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the Stale label Dec 9, 2022
@runforesight
Copy link

runforesight bot commented Dec 9, 2022

Foresight Summary

    
Major Impacts

build-and-test-windows duration(9 seconds) has decreased 30 minutes 25 seconds compared to main branch avg(30 minutes 34 seconds).
View More Details

✅  tracegen workflow has finished in 59 seconds (2 minutes 18 seconds less than main branch avg.) and finished at 12th Dec, 2022.


Job Failed Steps Tests
publish-latest -     🔗  N/A See Details
build-dev -     🔗  N/A See Details
publish-stable -     🔗  N/A See Details

⭕  build-and-test-windows workflow has finished in 9 seconds (30 minutes 25 seconds less than main branch avg.) and finished at 13th Apr, 2023.


Job Failed Steps Tests
windows-unittest-matrix -     🔗  N/A See Details
windows-unittest -     🔗  N/A See Details

✅  telemetrygen workflow has finished in 1 minute 14 seconds and finished at 13th Apr, 2023.


Job Failed Steps Tests
build-dev -     🔗  N/A See Details
publish-latest -     🔗  N/A See Details
publish-stable -     🔗  N/A See Details

✅  check-links workflow has finished in 1 minute 55 seconds (⚠️ 59 seconds more than main branch avg.) and finished at 13th Apr, 2023.


Job Failed Steps Tests
changed files -     🔗  N/A See Details
check-links -     🔗  N/A See Details

✅  changelog workflow has finished in 2 minutes 5 seconds and finished at 13th Apr, 2023.


Job Failed Steps Tests
changelog -     🔗  N/A See Details

✅  prometheus-compliance-tests workflow has finished in 3 minutes 13 seconds (3 minutes 7 seconds less than main branch avg.) and finished at 13th Apr, 2023.


Job Failed Steps Tests
prometheus-compliance-tests -     🔗  N/A See Details

✅  load-tests workflow has finished in 6 minutes 36 seconds (3 minutes 54 seconds less than main branch avg.) and finished at 13th Apr, 2023.


Job Failed Steps Tests
setup-environment -     🔗  N/A See Details
loadtest (TestIdleMode) -     🔗  N/A See Details
loadtest (TestBallastMemory|TestLog10kDPS) -     🔗  N/A See Details
loadtest (TestMetric10kDPS|TestMetricsFromFile) -     🔗  N/A See Details
loadtest (TestMetricResourceProcessor|TestTrace10kSPS) -     🔗  N/A See Details
loadtest (TestTraceNoBackend10kSPS|TestTrace1kSPSWithAttrs) -     🔗  N/A See Details
loadtest (TestTraceBallast1kSPSWithAttrs|TestTraceBallast1kSPSAddAttrs) -     🔗  N/A See Details
loadtest (TestTraceAttributesProcessor) -     🔗  N/A See Details

✅  e2e-tests workflow has finished in 13 minutes 27 seconds and finished at 13th Apr, 2023.


Job Failed Steps Tests
kubernetes-test (v1.25.3) -     🔗  N/A See Details
kubernetes-test (v1.24.7) -     🔗  N/A See Details
kubernetes-test (v1.26.0) -     🔗  N/A See Details
kubernetes-test (v1.23.13) -     🔗  N/A See Details

✅  build-and-test workflow has finished in 36 minutes 28 seconds (10 minutes 8 seconds less than main branch avg.) and finished at 13th Apr, 2023.


Job Failed Steps Tests
govulncheck -     🔗  N/A See Details
setup-environment -     🔗  N/A See Details
build-examples -     🔗  N/A See Details
check-collector-module-version -     🔗  N/A See Details
checks -     🔗  N/A See Details
check-codeowners -     🔗  N/A See Details
correctness-metrics -     🔗  N/A See Details
correctness-traces -     🔗  N/A See Details
integration-tests -     🔗  N/A See Details
lint-matrix (receiver-0) -     🔗  N/A See Details
lint-matrix (receiver-1) -     🔗  N/A See Details
lint-matrix (processor) -     🔗  N/A See Details
lint-matrix (exporter) -     🔗  N/A See Details
lint-matrix (extension) -     🔗  N/A See Details
lint-matrix (connector) -     🔗  N/A See Details
lint-matrix (internal) -     🔗  N/A See Details
lint-matrix (other) -     🔗  N/A See Details
unittest-matrix (1.20, receiver-0) -     🔗  N/A See Details
unittest-matrix (1.20, receiver-1) -     🔗  N/A See Details
unittest-matrix (1.20, processor) -     🔗  N/A See Details
unittest-matrix (1.20, exporter) -     🔗  N/A See Details
unittest-matrix (1.20, extension) -     🔗  N/A See Details
unittest-matrix (1.20, connector) -     🔗  N/A See Details
unittest-matrix (1.20, internal) -     🔗  N/A See Details
unittest-matrix (1.20, other) -     🔗  N/A See Details
unittest-matrix (1.19, receiver-0) -     🔗  N/A See Details
unittest-matrix (1.19, receiver-1) -     🔗  N/A See Details
unittest-matrix (1.19, processor) -     🔗  N/A See Details
unittest-matrix (1.19, exporter) -     🔗  N/A See Details
unittest-matrix (1.19, extension) -     🔗  N/A See Details
unittest-matrix (1.19, connector) -     🔗  N/A See Details
unittest-matrix (1.19, internal) -     🔗  N/A See Details
unittest-matrix (1.19, other) -     🔗  N/A See Details
lint -     🔗  N/A See Details
unittest (1.20) -     🔗  N/A See Details
unittest (1.19) -     🔗  N/A See Details
cross-compile (darwin, amd64) -     🔗  N/A See Details
cross-compile (darwin, arm64) -     🔗  N/A See Details
cross-compile (linux, 386) -     🔗  N/A See Details
cross-compile (linux, amd64) -     🔗  N/A See Details
cross-compile (linux, arm) -     🔗  N/A See Details
cross-compile (linux, arm64) -     🔗  N/A See Details
cross-compile (linux, ppc64le) -     🔗  N/A See Details
cross-compile (windows, 386) -     🔗  N/A See Details
cross-compile (windows, amd64) -     🔗  N/A See Details
build-package (deb) -     🔗  N/A See Details
build-package (rpm) -     🔗  N/A See Details
windows-msi -     🔗  N/A See Details
publish-check -     🔗  N/A See Details
publish-stable -     🔗  N/A See Details
publish-dev -     🔗  N/A See Details
rotate-milestone -     🔗  N/A See Details

🔎 See details on Foresight

*You can configure Foresight comments in your organization settings page.

Copy link
Member

@JaredTan95 JaredTan95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@leewoobin789
Copy link
Contributor Author

@dmitryax this pr needs one more approval. :) thank you in advance

@leewoobin789
Copy link
Contributor Author

just to prevent this pr being staled.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2023

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Jan 7, 2023
exporter/elasticsearchexporter/README.md Outdated Show resolved Hide resolved
exporter/elasticsearchexporter/README.md Outdated Show resolved Hide resolved
exporter/elasticsearchexporter/config.go Outdated Show resolved Hide resolved
@leewoobin789
Copy link
Contributor Author

is there anything else, which needs to be done here? :)

@vsellier
Copy link

Hello there,
Is there any blocker to merge this diff?

It's a important feature blocking for us to deploy opentelemetry with a production load without having a huge single index.

I volonteer to help if something more is needed 😄

@leewoobin789
Copy link
Contributor Author

Hello there,
Is there any blocker to merge this diff?

It's a important feature blocking for us to deploy opentelemetry with a production load without having a huge single index.

I volonteer to help if something more is needed 😄

Tbh I don't think there is things to do as it is already tested. I am also waiting for approver to merge it as well.

@leewoobin789
Copy link
Contributor Author

@vsellier I will solve any merge conflict and commit it.

@rpanand24
Copy link

Hi,
can someone authorized please help here to get this feature merged to main?
Our open telemetry migration is blocked because our use case also needs dynamic indexing.

@dmitryax dmitryax merged commit f5c1a88 into open-telemetry:main May 16, 2023
@dmitryax
Copy link
Member

Merged. Sorry for the delay

@github-actions github-actions bot added this to the next release milestone May 16, 2023
varunraiko pushed a commit to varunraiko/opentelemetry-collector-contrib that referenced this pull request May 17, 2023
…ogs and traces (open-telemetry#16094)

The elasticsearchexporter of current version takes each one static index for both logs and traces. The capability of dynamic indexing based on attributes (elasticsearch.index.prefix, elasticsearch.index.suffix) will help users to delegate the final index.
Until now, what I have seen solar is the usage of ingestion pipeline dedicatedly for rewriting index, which is the only way to write data to multiple indexes.

This way, users have multiple options to route their data to a prefixed or suffixed index by using resource processor or attribute processor in sidecar collector/ main collector or even by adding it as static attribute in application instrumentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants