├── internal ├── tools │ ├── Makefile │ ├── empty_test.go │ └── tools.go ├── testutil │ ├── Makefile │ └── go.mod └── sharedcomponent │ ├── Makefile │ ├── package_test.go │ └── go.mod ├── pkg └── integrations │ ├── Makefile │ ├── testdata │ ├── template-no-processors.yaml │ ├── template-simple.yaml │ ├── template-simple-2.yaml │ ├── template-missing-processor.yaml │ ├── template-missing-receiver.yaml │ └── template-unknown-fields.yaml │ └── go.mod ├── receiver ├── loadgenreceiver │ ├── Makefile │ ├── metadata.yaml │ ├── testdata │ │ └── config.yaml │ ├── doc.go │ ├── generated_package_test.go │ ├── internal │ │ ├── metadata │ │ │ └── generated_status.go │ │ └── list │ │ │ └── looping_test.go │ └── stats.go ├── elasticapmintakereceiver │ ├── Makefile │ ├── testdata │ │ ├── invalid-metadata-expected.txt │ │ ├── invalid-event-type-expected.txt │ │ ├── invalid-json-event-expected.txt │ │ ├── invalid-metadata-2-expected.txt │ │ ├── invalid-json-metadata-expected.txt │ │ ├── missing-agent-metadata-expected.txt │ │ ├── invalid-event-expected.txt │ │ ├── missing-agent-metadata.ndjson │ │ ├── integration │ │ │ └── Dockerfile.elasticsearch.8_18_x │ │ ├── config.yaml │ │ ├── invalid-event-type.ndjson │ │ ├── invalid-metadata-2.ndjson │ │ ├── invalid-metadata.ndjson │ │ ├── invalid-json-metadata.ndjson │ │ ├── invalid-json-event.ndjson │ │ ├── multiple_histogram_metrics_samples.ndjson │ │ ├── language_name_mapping.ndjson │ │ ├── span-links.ndjson │ │ ├── invalid-event.ndjson │ │ ├── hostdata.ndjson │ │ └── invalid_ids.ndjson │ ├── elasticapmintakereceiver_architecture.png │ ├── metadata.yaml │ ├── generated_package_test.go │ ├── doc.go │ └── internal │ │ ├── sharedcomponent │ │ └── package_test.go │ │ ├── mappers │ │ ├── attribute_helper.go │ │ └── idConverter.go │ │ └── metadata │ │ └── generated_status.go └── integrationreceiver │ ├── Makefile │ ├── testdata │ ├── templates │ │ ├── no-receiver.yaml │ │ └── filelog.yaml │ ├── logs │ │ └── test-simple.log │ ├── expected-logs-no-processing.yaml │ └── expected-logs-with-attributes.yaml │ ├── metadata.yaml │ ├── generated_package_test.go │ ├── doc.go │ ├── internal │ └── metadata │ │ └── generated_status.go │ └── config.go ├── extension ├── apmconfigextension │ ├── Makefile │ ├── testdata │ │ ├── unsupported_protocol.yaml │ │ ├── bad_no_proto_config.yaml │ │ ├── unsupported_duration.yaml │ │ ├── integration │ │ │ └── Dockerfile.elasticsearch.8_18_x │ │ └── default.yaml │ ├── extension-workflow.png │ ├── metadata.yaml │ ├── doc.go │ ├── generated_package_test.go │ ├── internal │ │ └── metadata │ │ │ └── generated_status.go │ ├── architecture.md │ └── logger.go ├── apikeyauthextension │ ├── Makefile │ ├── metadata.yaml │ ├── doc.go │ ├── generated_package_test.go │ ├── internal │ │ └── metadata │ │ │ └── generated_status.go │ ├── factory.go │ └── factory_test.go ├── fileintegrationextension │ ├── Makefile │ ├── testdata │ │ └── templates │ │ │ ├── invalid.yaml │ │ │ └── valid.yaml │ ├── metadata.yaml │ ├── generated_package_test.go │ ├── doc.go │ └── internal │ │ └── metadata │ │ └── generated_status.go ├── clientaddrmiddlewareextension │ ├── Makefile │ ├── metadata.yaml │ ├── doc.go │ ├── generated_package_test.go │ ├── README.md │ ├── config.go │ ├── internal │ │ └── metadata │ │ │ └── generated_status.go │ └── factory.go └── configintegrationextension │ ├── Makefile │ ├── metadata.yaml │ ├── testdata │ ├── valid-config-with-templates.yaml │ ├── config-unknown-key.yaml │ └── config-with-templates.yaml │ ├── generated_package_test.go │ ├── doc.go │ ├── internal │ └── metadata │ │ └── generated_status.go │ └── factory.go ├── connector ├── elasticapmconnector │ ├── Makefile │ ├── testdata │ │ ├── config │ │ │ ├── empty.yaml │ │ │ ├── aggregation.yaml │ │ │ ├── customattrs.yaml │ │ │ └── full.yaml │ │ ├── logs │ │ │ ├── service_summary │ │ │ │ ├── config.yaml │ │ │ │ └── input.yaml │ │ │ ├── service_summary_custom_attrs │ │ │ │ ├── config.yaml │ │ │ │ └── input.yaml │ │ │ ├── service_summary_overflow │ │ │ │ ├── config.yaml │ │ │ │ └── input.yaml │ │ │ └── service_summary_no_overflow │ │ │ │ ├── config.yaml │ │ │ │ └── input.yaml │ │ ├── metrics │ │ │ ├── service_summary │ │ │ │ ├── config.yaml │ │ │ │ └── input.yaml │ │ │ ├── service_summary_custom_attrs │ │ │ │ ├── config.yaml │ │ │ │ └── input.yaml │ │ │ ├── service_summary_overflow │ │ │ │ ├── config.yaml │ │ │ │ └── input.yaml │ │ │ └── service_summary_no_overflow │ │ │ │ ├── config.yaml │ │ │ │ └── input.yaml │ │ └── traces │ │ │ ├── span_metrics │ │ │ └── config.yaml │ │ │ ├── transaction_metrics │ │ │ └── config.yaml │ │ │ ├── span_metrics_custom_attrs │ │ │ └── config.yaml │ │ │ ├── transaction_metrics_custom_attrs │ │ │ └── config.yaml │ │ │ ├── span_metrics_overflow │ │ │ └── config.yaml │ │ │ ├── span_metrics_no_overflow │ │ │ └── config.yaml │ │ │ └── transaction_metrics_no_overflow │ │ │ └── config.yaml │ ├── metadata.yaml │ ├── generated_package_test.go │ ├── doc.go │ └── internal │ │ └── metadata │ │ └── generated_status.go └── profilingmetricsconnector │ ├── Makefile │ ├── generated_package_test.go │ ├── doc.go │ ├── README.md │ ├── internal │ └── metadata │ │ └── generated_status.go │ ├── testdata │ └── frame_metrics │ │ └── output-metrics.yaml │ └── config.go ├── loadgen ├── cmd │ ├── otelsoak │ │ ├── otelsoak │ │ └── README.md │ └── otelbench │ │ ├── Makefile │ │ └── .chloggen │ │ └── TEMPLATE.yaml └── README.md ├── processor ├── elasticapmprocessor │ ├── Makefile │ ├── metadata.yaml │ ├── testdata │ │ ├── skip_enrichment │ │ │ ├── logs_true_no_ecs_output.yaml │ │ │ ├── logs_false_input.yaml │ │ │ ├── logs_false_ecs_input.yaml │ │ │ ├── logs_true_ecs_input.yaml │ │ │ ├── logs_true_no_ecs_input.yaml │ │ │ ├── metrics_true_no_ecs_output.yaml │ │ │ ├── metrics_false_input.yaml │ │ │ ├── metrics_true_ecs_input.yaml │ │ │ ├── metrics_false_ecs_input.yaml │ │ │ ├── metrics_true_no_ecs_input.yaml │ │ │ ├── logs_false_output.yaml │ │ │ ├── metrics_false_output.yaml │ │ │ ├── logs_false_ecs_output.yaml │ │ │ ├── logs_true_ecs_output.yaml │ │ │ ├── metrics_false_ecs_output.yaml │ │ │ └── metrics_true_ecs_output.yaml │ │ ├── elastic_apm │ │ │ ├── logs_input.yaml │ │ │ ├── metrics_input.yaml │ │ │ ├── logs_output.yaml │ │ │ └── metrics_output.yaml │ │ ├── elastic_hostname │ │ │ ├── logs_input.yaml │ │ │ ├── metrics_input.yaml │ │ │ ├── spans_input.yaml │ │ │ ├── logs_output.yaml │ │ │ └── metrics_output.yaml │ │ ├── elastic_txn_db │ │ │ └── input.yaml │ │ ├── elastic_span_db │ │ │ └── input.yaml │ │ ├── elastic_txn_messaging │ │ │ └── input.yaml │ │ ├── elastic_span_messaging │ │ │ └── input.yaml │ │ ├── elastic_txn_http │ │ │ └── input.yaml │ │ └── elastic_span_http │ │ │ └── input.yaml │ ├── generated_package_test.go │ ├── doc.go │ └── internal │ │ └── metadata │ │ └── generated_status.go ├── integrationprocessor │ ├── Makefile │ ├── testdata │ │ ├── templates │ │ │ ├── empty.yaml │ │ │ ├── addattribute.yaml │ │ │ └── multipleprocessors.yaml │ │ ├── logs.yaml │ │ ├── expected-logs-no-processing.yaml │ │ ├── expected-logs-add-attribute.yaml │ │ └── expected-logs-processors-order.yaml │ ├── metadata.yaml │ ├── generated_package_test.go │ ├── doc.go │ └── internal │ │ └── metadata │ │ └── generated_status.go ├── lsmintervalprocessor │ ├── Makefile │ ├── testdata │ │ ├── merger │ │ │ ├── empty │ │ │ │ ├── input.yaml │ │ │ │ └── output.yaml │ │ │ ├── README.md │ │ │ └── single_metric │ │ │ │ ├── output.yaml │ │ │ │ └── input.yaml │ │ ├── sum_cumulative │ │ │ ├── next.yaml │ │ │ ├── output.yaml │ │ │ └── input.yaml │ │ ├── sum_delta │ │ │ ├── next.yaml │ │ │ ├── output.yaml │ │ │ └── input.yaml │ │ ├── exphistogram_delta │ │ │ └── next.yaml │ │ ├── histogram_delta │ │ │ ├── next.yaml │ │ │ ├── output.yaml │ │ │ └── input.yaml │ │ ├── exphistogram_cumulative │ │ │ └── next.yaml │ │ ├── histogram_cumulative │ │ │ ├── next.yaml │ │ │ └── output.yaml │ │ ├── histogram_delta_overflow │ │ │ └── next.yaml │ │ ├── sum_cumulative_overflow │ │ │ └── next.yaml │ │ ├── sum_delta_overflow │ │ │ └── next.yaml │ │ ├── summary_enabled │ │ │ ├── next.yaml │ │ │ └── output.yaml │ │ ├── summary_passthrough │ │ │ └── output.yaml │ │ ├── exphistogram_delta_overflow │ │ │ └── next.yaml │ │ ├── histogram_cumulative_overflow │ │ │ └── next.yaml │ │ └── exphistogram_cumulative_overflow │ │ │ └── next.yaml │ ├── README.md │ ├── generated_package_test.go │ ├── doc.go │ └── internal │ │ ├── metadata │ │ └── generated_status.go │ │ ├── identity │ │ ├── doc.go │ │ └── strings.go │ │ └── data │ │ └── expo │ │ └── ord.go ├── ratelimitprocessor │ ├── Makefile │ ├── doc.go │ ├── generated_package_test.go │ └── internal │ │ └── metadata │ │ └── generated_status.go ├── elasticinframetricsprocessor │ ├── Makefile │ ├── metadata.yaml │ ├── testdata │ │ ├── config.yaml │ │ ├── k8smetrics │ │ │ └── input-metrics.yaml │ │ └── k8smetrics_drop_original │ │ │ └── input-metrics.yaml │ ├── doc.go │ ├── generated_package_test.go │ ├── config.go │ └── internal │ │ └── metadata │ │ └── generated_status.go └── elastictraceprocessor │ ├── Makefile │ ├── README.md │ ├── metadata.yaml │ ├── generated_package_test.go │ └── internal │ └── metadata │ └── generated_status.go ├── .gitignore ├── CODE_OF_CONDUCT.md ├── distributions └── elastic-components │ ├── config.yaml │ ├── Dockerfile │ └── README.md └── .github ├── renovate.json5 ├── dependabot.yml ├── workflows ├── scripts │ ├── create_pr.sh │ └── check_release.sh └── release_otelbench.yaml └── CODEOWNERS /internal/tools/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /internal/testutil/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /pkg/integrations/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /receiver/loadgenreceiver/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common -------------------------------------------------------------------------------- /extension/apmconfigextension/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common -------------------------------------------------------------------------------- /internal/sharedcomponent/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /extension/apikeyauthextension/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /loadgen/cmd/otelsoak/otelsoak: -------------------------------------------------------------------------------- 1 | ../../../_build/elastic-collector-components -------------------------------------------------------------------------------- /processor/elasticapmprocessor/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /processor/integrationprocessor/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/merger/empty/input.yaml: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/merger/empty/output.yaml: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /processor/ratelimitprocessor/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common -------------------------------------------------------------------------------- /receiver/integrationreceiver/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/config/empty.yaml: -------------------------------------------------------------------------------- 1 | elasticapm: {} 2 | -------------------------------------------------------------------------------- /connector/profilingmetricsconnector/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /extension/fileintegrationextension/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /processor/elasticinframetricsprocessor/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common -------------------------------------------------------------------------------- /processor/elastictraceprocessor/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /extension/clientaddrmiddlewareextension/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /extension/configintegrationextension/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /processor/integrationprocessor/testdata/templates/empty.yaml: -------------------------------------------------------------------------------- 1 | pipelines: 2 | logs: 3 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/sum_cumulative/next.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: [] 2 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/sum_delta/next.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: [] 2 | 3 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/logs/service_summary/config.yaml: -------------------------------------------------------------------------------- 1 | elasticapm: {} 2 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/metrics/service_summary/config.yaml: -------------------------------------------------------------------------------- 1 | elasticapm: {} 2 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/traces/span_metrics/config.yaml: -------------------------------------------------------------------------------- 1 | elasticapm: {} 2 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/exphistogram_delta/next.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: [] 2 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/histogram_delta/next.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: [] 2 | -------------------------------------------------------------------------------- /receiver/integrationreceiver/testdata/templates/no-receiver.yaml: -------------------------------------------------------------------------------- 1 | pipelines: 2 | logs: 3 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/traces/transaction_metrics/config.yaml: -------------------------------------------------------------------------------- 1 | elasticapm: {} 2 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/exphistogram_cumulative/next.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: [] 2 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/histogram_cumulative/next.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: [] 2 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/histogram_delta_overflow/next.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: [] 2 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/sum_cumulative_overflow/next.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: [] 2 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/sum_delta_overflow/next.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: [] 2 | 3 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/summary_enabled/next.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: [] 2 | 3 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/summary_passthrough/output.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: [] 2 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/exphistogram_delta_overflow/next.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: [] 2 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/histogram_cumulative_overflow/next.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: [] 2 | -------------------------------------------------------------------------------- /receiver/integrationreceiver/testdata/logs/test-simple.log: -------------------------------------------------------------------------------- 1 | this is a log 2 | this is another log 3 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/exphistogram_cumulative_overflow/next.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: [] 2 | -------------------------------------------------------------------------------- /processor/elastictraceprocessor/README.md: -------------------------------------------------------------------------------- 1 | The `elastictraceprocessor` processor is deprecated in favor of the `elasticapm` processor. -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | .tools/ 3 | .release/ 4 | _build/ 5 | 6 | ### IntelliJ IDEA ### 7 | .idea/ 8 | *.iws 9 | *.iml 10 | *.ipr 11 | -------------------------------------------------------------------------------- /extension/apmconfigextension/testdata/unsupported_protocol.yaml: -------------------------------------------------------------------------------- 1 | opamp: 2 | protocols: 3 | ws: 4 | endpoint: "localhost:4320" 5 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/testdata/invalid-metadata-expected.txt: -------------------------------------------------------------------------------- 1 | {"accepted":0,"errors":["validation error: 'metadata' required"]} 2 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/testdata/invalid-event-type-expected.txt: -------------------------------------------------------------------------------- 1 | {"accepted":0,"errors":["did not recognize object type: \"tennis-court\""]} 2 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/testdata/invalid-json-event-expected.txt: -------------------------------------------------------------------------------- 1 | {"accepted":1,"errors":["did not recognize object type: \"invalid-json\""]} 2 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | This project follows the [Elastic Community Code of Conduct](https://www.elastic.co/community/codeofconduct). 4 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/logs/service_summary_custom_attrs/config.yaml: -------------------------------------------------------------------------------- 1 | elasticapm: 2 | custom_resource_attributes: 3 | - foo 4 | - foo.404 5 | -------------------------------------------------------------------------------- /extension/apmconfigextension/testdata/bad_no_proto_config.yaml: -------------------------------------------------------------------------------- 1 | opamp: 2 | protocols: 3 | source: 4 | elasticsearch: 5 | endpoint: "https://testing/opamp" 6 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/metrics/service_summary_custom_attrs/config.yaml: -------------------------------------------------------------------------------- 1 | elasticapm: 2 | custom_resource_attributes: 3 | - foo 4 | - foo.404 5 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/testdata/invalid-metadata-2-expected.txt: -------------------------------------------------------------------------------- 1 | {"accepted":0,"errors":["cannot read metadata in stream: \"metadata\" or \"m\" required"]} 2 | -------------------------------------------------------------------------------- /extension/fileintegrationextension/testdata/templates/invalid.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | foo: 3 | setting: ${var:setting} 4 | 5 | processors: 6 | foo: ~ 7 | 8 | pipelines 9 | -------------------------------------------------------------------------------- /extension/apmconfigextension/extension-workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/opentelemetry-collector-components/HEAD/extension/apmconfigextension/extension-workflow.png -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/testdata/invalid-json-metadata-expected.txt: -------------------------------------------------------------------------------- 1 | {"accepted":0,"errors":["decode error: data read error: v2.metadataRoot.Metadata: v2.metadata.readFieldHash: expect :,"]} 2 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/testdata/missing-agent-metadata-expected.txt: -------------------------------------------------------------------------------- 1 | {"accepted":0,"errors":["validation error: metadata: service: agent: 'name': validation rule 'minLength(1)' violated"]} 2 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/config/aggregation.yaml: -------------------------------------------------------------------------------- 1 | elasticapm: 2 | aggregation: 3 | directory: /path/to/aggregation/state 4 | metadata_keys: [a, B, c] 5 | intervals: [1s, 1m] 6 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/config/customattrs.yaml: -------------------------------------------------------------------------------- 1 | elasticapm: 2 | custom_resource_attributes: 3 | - res.1 4 | - res.2 5 | custom_span_attributes: 6 | - span.1 7 | - span.2 8 | -------------------------------------------------------------------------------- /extension/fileintegrationextension/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: file_integrations 2 | status: 3 | class: extension 4 | stability: 5 | development: [extension] 6 | codeowners: 7 | active: [jsoriano] 8 | -------------------------------------------------------------------------------- /extension/configintegrationextension/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: config_integrations 2 | status: 3 | class: extension 4 | stability: 5 | development: [extension] 6 | codeowners: 7 | active: [jsoriano] 8 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/testdata/invalid-event-expected.txt: -------------------------------------------------------------------------------- 1 | {"accepted":1,"errors":["decode error: data read error: v2.transactionRoot.Transaction: v2.transaction.ID: ReadString: expects \" or n,"]} 2 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/elasticapmintakereceiver_architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/opentelemetry-collector-components/HEAD/receiver/elasticapmintakereceiver/elasticapmintakereceiver_architecture.png -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/traces/span_metrics_custom_attrs/config.yaml: -------------------------------------------------------------------------------- 1 | elasticapm: 2 | custom_resource_attributes: 3 | - foo 4 | - foo.404 5 | custom_span_attributes: 6 | - span.foo 7 | - span.foo.404 8 | -------------------------------------------------------------------------------- /extension/apmconfigextension/testdata/unsupported_duration.yaml: -------------------------------------------------------------------------------- 1 | source: 2 | elasticsearch: 3 | endpoint: "https://test" 4 | cache_duration: 0s 5 | opamp: 6 | protocols: 7 | http: 8 | endpoint: "localhost:4320" 9 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/traces/transaction_metrics_custom_attrs/config.yaml: -------------------------------------------------------------------------------- 1 | elasticapm: 2 | custom_resource_attributes: 3 | - foo 4 | - foo.404 5 | custom_span_attributes: 6 | - span.foo 7 | - span.foo.404 8 | -------------------------------------------------------------------------------- /extension/fileintegrationextension/testdata/templates/valid.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | foo: 3 | setting: ${var:setting} 4 | 5 | processors: 6 | foo: ~ 7 | 8 | pipelines: 9 | metrics/1: 10 | receiver: foo 11 | processors: [foo] 12 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/testdata/missing-agent-metadata.ndjson: -------------------------------------------------------------------------------- 1 | {"metadata": {"service": {"name": "1234_service-12a3", "version": "4.3.0", "agent": {"version": "", "name": ""}}}} 2 | {"log": {"message": "test log message without timestamp"}} -------------------------------------------------------------------------------- /extension/apmconfigextension/testdata/integration/Dockerfile.elasticsearch.8_18_x: -------------------------------------------------------------------------------- 1 | FROM elasticsearch:8.18.1 2 | 3 | ENV discovery.type=single-node 4 | 5 | ENV ES_JAVA_OPTS='-Xms512m -Xmx512m' 6 | ENV xpack.security.enabled=false 7 | 8 | EXPOSE 9200 9 | -------------------------------------------------------------------------------- /processor/integrationprocessor/testdata/templates/addattribute.yaml: -------------------------------------------------------------------------------- 1 | processors: 2 | transform: 3 | log_statements: 4 | - set(log.attributes["resource"], "${var:resource}") 5 | 6 | pipelines: 7 | logs: 8 | processors: 9 | - transform 10 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/testdata/integration/Dockerfile.elasticsearch.8_18_x: -------------------------------------------------------------------------------- 1 | FROM elasticsearch:8.18.1 2 | 3 | ENV discovery.type=single-node 4 | 5 | ENV ES_JAVA_OPTS='-Xms512m -Xmx512m' 6 | ENV xpack.security.enabled=false 7 | 8 | EXPOSE 9200 9 | 10 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: elasticapm 2 | scope_name: github.com/elastic/opentelemetry-collector-components/processor/elasticapmprocessor 3 | 4 | status: 5 | class: processor 6 | stability: 7 | alpha: [traces, metrics, logs] 8 | distributions: [] 9 | -------------------------------------------------------------------------------- /extension/apikeyauthextension/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: apikeyauth 2 | scope_name: github.com/elastic/opentelemetry-collector-components/extension/apikeyauthextension 3 | 4 | status: 5 | class: extension 6 | stability: 7 | development: [extension] 8 | 9 | tests: 10 | config: 11 | -------------------------------------------------------------------------------- /receiver/loadgenreceiver/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: loadgen 2 | github_project: elastic/opentelemetry-collector-components 3 | 4 | status: 5 | class: receiver 6 | stability: 7 | development: [metrics, logs, traces] 8 | distributions: [] 9 | # codeowners: 10 | # active: [] 11 | 12 | -------------------------------------------------------------------------------- /extension/apmconfigextension/testdata/default.yaml: -------------------------------------------------------------------------------- 1 | # The following entry initializes the default apmconfig extension. 2 | # The full name of this extension is `apmconfig` and can be referenced in pipelines by 'apmconfig'. 3 | opamp: 4 | protocols: 5 | http: 6 | endpoint: "localhost:4320" 7 | -------------------------------------------------------------------------------- /processor/integrationprocessor/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: integration 2 | 3 | status: 4 | class: processor 5 | stability: 6 | development: [logs, metrics, traces] 7 | codeowners: 8 | active: [jsoriano] 9 | 10 | tests: 11 | skip_lifecycle: true # It depends on other processors to be available. 12 | -------------------------------------------------------------------------------- /receiver/integrationreceiver/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: integration 2 | 3 | status: 4 | class: receiver 5 | stability: 6 | development: [logs, metrics, traces] 7 | codeowners: 8 | active: [jsoriano] 9 | 10 | tests: 11 | skip_lifecycle: true # It depends on other receivers to be available. 12 | -------------------------------------------------------------------------------- /extension/clientaddrmiddlewareextension/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: clientaddrmiddleware 2 | scope_name: github.com/elastic/opentelemetry-collector-components/extension/clientaddrmiddlewareextension 3 | 4 | status: 5 | class: extension 6 | stability: 7 | development: [extension] 8 | 9 | tests: 10 | config: 11 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/logs/service_summary_overflow/config.yaml: -------------------------------------------------------------------------------- 1 | elasticapm: 2 | aggregation: 3 | limits: 4 | resource: 5 | max_cardinality: 1 6 | scope: 7 | max_cardinality: 1 8 | metric: 9 | max_cardinality: 1 10 | datapoint: 11 | max_cardinality: 1 12 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/traces/span_metrics_overflow/config.yaml: -------------------------------------------------------------------------------- 1 | elasticapm: 2 | aggregation: 3 | limits: 4 | resource: 5 | max_cardinality: 1 6 | scope: 7 | max_cardinality: 1 8 | metric: 9 | max_cardinality: 1 10 | datapoint: 11 | max_cardinality: 1 12 | -------------------------------------------------------------------------------- /extension/configintegrationextension/testdata/valid-config-with-templates.yaml: -------------------------------------------------------------------------------- 1 | integrations: 2 | valid: | 3 | receivers: 4 | foo: 5 | setting: $${var:setting} 6 | 7 | processors: 8 | foo: ~ 9 | 10 | pipelines: 11 | metrics/1: 12 | receiver: foo 13 | processors: [foo] 14 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/logs/service_summary_no_overflow/config.yaml: -------------------------------------------------------------------------------- 1 | elasticapm: 2 | aggregation: 3 | limits: 4 | resource: 5 | max_cardinality: 1 6 | scope: 7 | max_cardinality: 1 8 | metric: 9 | max_cardinality: 1 10 | datapoint: 11 | max_cardinality: 1 12 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/metrics/service_summary_overflow/config.yaml: -------------------------------------------------------------------------------- 1 | elasticapm: 2 | aggregation: 3 | limits: 4 | resource: 5 | max_cardinality: 1 6 | scope: 7 | max_cardinality: 1 8 | metric: 9 | max_cardinality: 1 10 | datapoint: 11 | max_cardinality: 1 12 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/traces/span_metrics_no_overflow/config.yaml: -------------------------------------------------------------------------------- 1 | elasticapm: 2 | aggregation: 3 | limits: 4 | resource: 5 | max_cardinality: 4 6 | scope: 7 | max_cardinality: 4 8 | metric: 9 | max_cardinality: 4 10 | datapoint: 11 | max_cardinality: 4 12 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/metrics/service_summary_no_overflow/config.yaml: -------------------------------------------------------------------------------- 1 | elasticapm: 2 | aggregation: 3 | limits: 4 | resource: 5 | max_cardinality: 1 6 | scope: 7 | max_cardinality: 1 8 | metric: 9 | max_cardinality: 1 10 | datapoint: 11 | max_cardinality: 1 12 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/traces/transaction_metrics_no_overflow/config.yaml: -------------------------------------------------------------------------------- 1 | elasticapm: 2 | aggregation: 3 | limits: 4 | resource: 5 | max_cardinality: 4 6 | scope: 7 | max_cardinality: 4 8 | metric: 9 | max_cardinality: 4 10 | datapoint: 11 | max_cardinality: 4 12 | -------------------------------------------------------------------------------- /processor/elasticinframetricsprocessor/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: elasticinframetrics 2 | 3 | status: 4 | class: processor 5 | stability: 6 | deprecated: [metrics] 7 | deprecation: 8 | metrics: 9 | migration: "The use of native OTel schema is only supported" 10 | date: "2025-11-06" 11 | codeowners: 12 | active: [ishleenk17] 13 | -------------------------------------------------------------------------------- /processor/integrationprocessor/testdata/logs.yaml: -------------------------------------------------------------------------------- 1 | resourceLogs: 2 | - resource: 3 | attributes: 4 | scopeLogs: 5 | - logRecords: 6 | - body: 7 | stringValue: "one log line" 8 | attributes: 9 | - key: log.file.name 10 | value: 11 | stringValue: test.log 12 | -------------------------------------------------------------------------------- /pkg/integrations/testdata/template-no-processors.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | foo: 3 | somesetting: ${var:somevalue} 4 | bar: 5 | somecomplexsetting: 6 | someobject: 7 | value: ${var:value} 8 | other: ${var:othervalue} 9 | 10 | processors: 11 | someprocessor: 12 | otherprocessor: 13 | third: 14 | option: ${var:option} 15 | -------------------------------------------------------------------------------- /extension/configintegrationextension/testdata/config-unknown-key.yaml: -------------------------------------------------------------------------------- 1 | integrations: 2 | valid: | 3 | receivers: 4 | foo: 5 | setting: $${var:setting} 6 | 7 | processors: 8 | foo: ~ 9 | 10 | extensions: 11 | foo: ~ 12 | 13 | pipelines: 14 | metrics/1: 15 | receiver: foo 16 | processors: [foo, bar] 17 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/skip_enrichment/logs_true_no_ecs_output.yaml: -------------------------------------------------------------------------------- 1 | resourceLogs: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: test-service 7 | scopeLogs: 8 | - logRecords: 9 | - body: 10 | stringValue: test log message 11 | scope: {} 12 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: elasticapmintake 2 | scope_name: github.com/elastic/opentelemetry-collector-components/receiver/elasticapmintakereceiver 3 | github_project: elastic/opentelemetry-collector-components 4 | 5 | status: 6 | class: receiver 7 | stability: 8 | alpha: [metrics, logs, traces] 9 | #codeowners: 10 | # active: [] 11 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/merger/README.md: -------------------------------------------------------------------------------- 1 | ## Test data for validating metrics merge 2 | 3 | The test data in this directory is for testing merging for `Value#MergeMetric` method. The directory structure is: 4 | 5 | ```txt 6 | 7 | | `input.yaml` (the input `pmetric.Metrics`) 8 | | `output.yaml` (the final output of the merge operation) 9 | ``` 10 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/elastic_apm/logs_input.yaml: -------------------------------------------------------------------------------- 1 | resourceLogs: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: test-service 7 | scopeLogs: 8 | - logRecords: 9 | - body: 10 | stringValue: test log message 11 | timeUnixNano: "0" 12 | scope: {} 13 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/skip_enrichment/logs_false_input.yaml: -------------------------------------------------------------------------------- 1 | resourceLogs: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: test-service 7 | scopeLogs: 8 | - logRecords: 9 | - body: 10 | stringValue: test log message 11 | timeUnixNano: "0" 12 | scope: {} 13 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/README.md: -------------------------------------------------------------------------------- 1 | ## LSM interval processor 2 | 3 | [Interval processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/intervalprocessor) rewrite with db-backed persistence. 4 | 5 | See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/33949 for discussion on implementing persistence for upstream interval processor. 6 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/skip_enrichment/logs_false_ecs_input.yaml: -------------------------------------------------------------------------------- 1 | resourceLogs: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: test-service 7 | scopeLogs: 8 | - logRecords: 9 | - body: 10 | stringValue: test log message 11 | timeUnixNano: "0" 12 | scope: {} 13 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/skip_enrichment/logs_true_ecs_input.yaml: -------------------------------------------------------------------------------- 1 | resourceLogs: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: test-service 7 | scopeLogs: 8 | - logRecords: 9 | - body: 10 | stringValue: test log message 11 | timeUnixNano: "0" 12 | scope: {} 13 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/skip_enrichment/logs_true_no_ecs_input.yaml: -------------------------------------------------------------------------------- 1 | resourceLogs: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: test-service 7 | scopeLogs: 8 | - logRecords: 9 | - body: 10 | stringValue: test log message 11 | timeUnixNano: "0" 12 | scope: {} 13 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/testdata/config.yaml: -------------------------------------------------------------------------------- 1 | elasticapmintake: 2 | 3 | elasticapmintake/elasticsearch_agentcfg: 4 | agent_config: 5 | enabled: true 6 | cache_duration: 10s 7 | elasticsearch: 8 | endpoint: "http://localhost:8200" 9 | 10 | elasticapmintake/invalid_elasticsearch_agentcfg: 11 | agent_config: 12 | enabled: true 13 | elasticsearch: 14 | endpoint: "" 15 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/skip_enrichment/metrics_true_no_ecs_output.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: test-service 7 | scopeMetrics: 8 | - metrics: 9 | - gauge: 10 | dataPoints: 11 | - asInt: "123" 12 | name: test_metric 13 | scope: {} 14 | -------------------------------------------------------------------------------- /extension/apmconfigextension/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: apmconfig 2 | 3 | status: 4 | class: extension 5 | stability: 6 | development: [extension] 7 | distributions: [] 8 | codeowners: 9 | active: [rogercoll] 10 | 11 | tests: 12 | config: 13 | opamp: 14 | protocols: 15 | http: 16 | endpoint: localhost:8200 17 | source: 18 | elasticsearch: 19 | endpoint: http://localhost:8200 20 | -------------------------------------------------------------------------------- /processor/integrationprocessor/testdata/expected-logs-no-processing.yaml: -------------------------------------------------------------------------------- 1 | resourceLogs: 2 | - resource: {} 3 | scopeLogs: 4 | - logRecords: 5 | - attributes: 6 | - key: log.file.name 7 | value: 8 | stringValue: test.log 9 | body: 10 | stringValue: one log line 11 | spanId: "" 12 | traceId: "" 13 | scope: {} 14 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/testdata/invalid-event-type.ndjson: -------------------------------------------------------------------------------- 1 | {"metadata": {"user": null, "process": {"ppid": null, "pid": 1234, "argv": null, "title": null}, "system": null, "service": {"name": "1234_service-12a3", "language": {"version": null, "name":"ecmascript"}, "agent": {"version": "3.14.0", "name": "elastic-node"}, "environment": null, "framework": null,"version": null, "runtime": null}}} 2 | {"tennis-court": {"name": "Centre Court, Wimbledon"}} -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/elastic_apm/metrics_input.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: test-service 7 | scopeMetrics: 8 | - metrics: 9 | - name: test_metric 10 | gauge: 11 | dataPoints: 12 | - asInt: 123 13 | timeUnixNano: "0" 14 | scope: {} 15 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/skip_enrichment/metrics_false_input.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: test-service 7 | scopeMetrics: 8 | - metrics: 9 | - name: test_metric 10 | gauge: 11 | dataPoints: 12 | - asInt: 123 13 | timeUnixNano: "0" 14 | scope: {} 15 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/skip_enrichment/metrics_true_ecs_input.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: test-service 7 | scopeMetrics: 8 | - metrics: 9 | - name: test_metric 10 | gauge: 11 | dataPoints: 12 | - asInt: 123 13 | timeUnixNano: "0" 14 | scope: {} 15 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/skip_enrichment/metrics_false_ecs_input.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: test-service 7 | scopeMetrics: 8 | - metrics: 9 | - name: test_metric 10 | gauge: 11 | dataPoints: 12 | - asInt: 123 13 | timeUnixNano: "0" 14 | scope: {} 15 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/skip_enrichment/metrics_true_no_ecs_input.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: test-service 7 | scopeMetrics: 8 | - metrics: 9 | - name: test_metric 10 | gauge: 11 | dataPoints: 12 | - asInt: 123 13 | timeUnixNano: "0" 14 | scope: {} 15 | -------------------------------------------------------------------------------- /processor/elastictraceprocessor/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: elastictrace 2 | scope_name: github.com/elastic/opentelemetry-collector-components/processor/elastictraceprocessor 3 | 4 | status: 5 | class: processor 6 | stability: 7 | deprecated: [traces] 8 | distributions: [] 9 | deprecation: 10 | traces: 11 | date: "2025-10-08" 12 | migration: "Use the elasticapm processor instead, which is a drop-in replacement which supports traces, metrics, and logs." -------------------------------------------------------------------------------- /connector/elasticapmconnector/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: elasticapm 2 | scope_name: github.com/elastic/opentelemetry-collector-components/connector/elasticapmconnector 3 | github_project: elastic/opentelemetry-collector-components 4 | 5 | status: 6 | class: connector 7 | stability: 8 | development: 9 | - logs_to_metrics 10 | - metrics_to_metrics 11 | - traces_to_metrics 12 | distributions: [] 13 | warnings: [Statefulness] 14 | 15 | tests: 16 | config: 17 | -------------------------------------------------------------------------------- /extension/configintegrationextension/testdata/config-with-templates.yaml: -------------------------------------------------------------------------------- 1 | integrations: 2 | valid: | 3 | receivers: 4 | foo: 5 | setting: $${var:setting} 6 | 7 | processors: 8 | foo: ~ 9 | 10 | pipelines: 11 | metrics/1: 12 | receiver: foo 13 | processors: [foo] 14 | 15 | invalid: | 16 | receivers: 17 | foo: 18 | setting: $${var:setting} 19 | 20 | processors: 21 | foo: ~ 22 | 23 | pipelines 24 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/elastic_hostname/logs_input.yaml: -------------------------------------------------------------------------------- 1 | resourceLogs: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: test-service 7 | - key: host.hostname 8 | value: 9 | stringValue: hostname-1 10 | scopeLogs: 11 | - logRecords: 12 | - body: 13 | stringValue: test log message 14 | timeUnixNano: "0" 15 | scope: {} 16 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/testdata/invalid-metadata-2.ndjson: -------------------------------------------------------------------------------- 1 | {"not": "metadata"} 2 | {"metricset": { "samples": { "byte_counter": { "value": 1 }, "short_counter": { "value": 227 }, "integer_gauge": { "value": 42767 }, "long_gauge": { "value": 3147483648 }, "float_gauge": { "value": 9.16 }, "double_gauge": { "value": 3.141592653589793 }, "dotted.float.gauge": { "value": 6.12 }, "negative.d.o.t.t.e.d": { "value": -1022 } }, "tags": { "code": "200", "key": "abc" }, "timestamp": 1496170422281000 }} -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/testdata/invalid-metadata.ndjson: -------------------------------------------------------------------------------- 1 | {"metadata": {"user": null}} 2 | {"metricset": { "samples": { "byte_counter": { "value": 1 }, "short_counter": { "value": 227 }, "integer_gauge": { "value": 42767 }, "long_gauge": { "value": 3147483648 }, "float_gauge": { "value": 9.16 }, "double_gauge": { "value": 3.141592653589793 }, "dotted.float.gauge": { "value": 6.12 }, "negative.d.o.t.t.e.d": { "value": -1022 } }, "tags": { "code": "200", "some": "abc" }, "timestamp": 1496170422281000 }} -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/testdata/invalid-json-metadata.ndjson: -------------------------------------------------------------------------------- 1 | {"metadata": {"invalid-json"}} 2 | {"metricset": { "samples": { "byte_counter": { "value": 1 }, "short_counter": { "value": 227 }, "integer_gauge": { "value": 42767 }, "long_gauge": { "value": 3147483648 }, "float_gauge": { "value": 9.16 }, "double_gauge": { "value": 3.141592653589793 }, "dotted.float.gauge": { "value": 6.12 }, "negative.d.o.t.t.e.d": { "value": -1022 } }, "tags": { "code": "200", "code": "abc" }, "timestamp": 1496170422281000 }} -------------------------------------------------------------------------------- /internal/testutil/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/elastic/opentelemetry-collector-components/internal/testutil 2 | 3 | go 1.23.8 4 | 5 | require github.com/stretchr/testify v1.11.1 6 | 7 | require ( 8 | github.com/davecgh/go-spew v1.1.1 // indirect 9 | github.com/kr/pretty v0.3.1 // indirect 10 | github.com/pmezard/go-difflib v1.0.0 // indirect 11 | github.com/rogpeppe/go-internal v1.12.0 // indirect 12 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect 13 | gopkg.in/yaml.v3 v3.0.1 // indirect 14 | ) 15 | -------------------------------------------------------------------------------- /processor/integrationprocessor/testdata/expected-logs-add-attribute.yaml: -------------------------------------------------------------------------------- 1 | resourceLogs: 2 | - resource: {} 3 | scopeLogs: 4 | - logRecords: 5 | - attributes: 6 | - key: log.file.name 7 | value: 8 | stringValue: test.log 9 | - key: resource 10 | value: 11 | stringValue: test 12 | body: 13 | stringValue: one log line 14 | spanId: "" 15 | traceId: "" 16 | scope: {} 17 | -------------------------------------------------------------------------------- /processor/integrationprocessor/testdata/expected-logs-processors-order.yaml: -------------------------------------------------------------------------------- 1 | resourceLogs: 2 | - resource: {} 3 | scopeLogs: 4 | - logRecords: 5 | - attributes: 6 | - key: log.file.name 7 | value: 8 | stringValue: test.log 9 | - key: resource 10 | value: 11 | stringValue: test 12 | body: 13 | stringValue: one log line 14 | spanId: "" 15 | traceId: "" 16 | scope: {} 17 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/skip_enrichment/logs_false_output.yaml: -------------------------------------------------------------------------------- 1 | resourceLogs: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: test-service 7 | - key: agent.name 8 | value: 9 | stringValue: otlp 10 | - key: agent.version 11 | value: 12 | stringValue: unknown 13 | scopeLogs: 14 | - logRecords: 15 | - body: 16 | stringValue: test log message 17 | scope: {} 18 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/config/full.yaml: -------------------------------------------------------------------------------- 1 | elasticapm: 2 | aggregation: 3 | directory: /path/to/aggregation/state 4 | metadata_keys: [a, B, c] 5 | intervals: [1s, 1m] 6 | limits: 7 | resource: 8 | max_cardinality: 1 9 | scope: 10 | max_cardinality: 1 11 | metric: 12 | max_cardinality: 1 13 | datapoint: 14 | max_cardinality: 1 15 | custom_resource_attributes: 16 | - res.1 17 | - res.2 18 | custom_span_attributes: 19 | - span.1 20 | - span.2 21 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/elastic_hostname/metrics_input.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: test-service 7 | - key: host.hostname 8 | value: 9 | stringValue: hostname-1 10 | scopeMetrics: 11 | - metrics: 12 | - name: test_metric 13 | gauge: 14 | dataPoints: 15 | - asInt: 123 16 | timeUnixNano: "0" 17 | scope: {} 18 | -------------------------------------------------------------------------------- /distributions/elastic-components/config.yaml: -------------------------------------------------------------------------------- 1 | extensions: 2 | 3 | receivers: 4 | nop: 5 | 6 | processors: 7 | elasticinframetrics: 8 | add_system_metrics: 9 | elasticapm: 10 | 11 | exporters: 12 | nop: 13 | 14 | connectors: 15 | 16 | service: 17 | pipelines: 18 | logs: 19 | exporters: [nop] 20 | processors: 21 | receivers: [nop] 22 | traces: 23 | exporters: [nop] 24 | processors: 25 | receivers: [nop] 26 | metrics: 27 | exporters: [nop] 28 | processors: 29 | receivers: [nop] 30 | -------------------------------------------------------------------------------- /pkg/integrations/testdata/template-simple.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | foo: 3 | somesetting: ${var:somevalue} 4 | bar: 5 | somecomplexsetting: 6 | someobject: 7 | value: ${var:value} 8 | other: ${var:othervalue} 9 | 10 | processors: 11 | someprocessor: 12 | otherprocessor: 13 | third: 14 | option: ${var:option} 15 | 16 | pipelines: 17 | metrics: 18 | receiver: foo 19 | processors: [someprocessor, otherprocessor] 20 | logs: 21 | receiver: bar 22 | processors: 23 | - third 24 | logs/raw: 25 | receiver: bar 26 | -------------------------------------------------------------------------------- /receiver/loadgenreceiver/testdata/config.yaml: -------------------------------------------------------------------------------- 1 | loadgen: 2 | 3 | loadgen/logs_invalid_max_replay: 4 | logs: 5 | max_replay: -1 6 | 7 | loadgen/metrics_invalid_max_replay: 8 | metrics: 9 | max_replay: -1 10 | 11 | loadgen/traces_invalid_max_replay: 12 | traces: 13 | max_replay: -1 14 | 15 | loadgen/logs_invalid_max_buffer_size: 16 | logs: 17 | max_buffer_size: -1 18 | 19 | loadgen/metrics_invalid_max_buffer_size: 20 | metrics: 21 | max_buffer_size: -1 22 | 23 | loadgen/traces_invalid_max_buffer_size: 24 | traces: 25 | max_buffer_size: -1 26 | -------------------------------------------------------------------------------- /pkg/integrations/testdata/template-simple-2.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | foo: 3 | somesetting: ${var:somevalue} 4 | bar: 5 | somecomplexsetting: 6 | someobject: 7 | value: ${var:value} 8 | other: ${var:othervalue} 9 | 10 | processors: 11 | someprocessor: 12 | otherprocessor: 13 | third: 14 | option: ${var:option} 15 | 16 | pipelines: 17 | metrics/2: 18 | receiver: foo 19 | processors: [someprocessor, otherprocessor] 20 | logs/2: 21 | receiver: bar 22 | processors: 23 | - third 24 | logs/raw2: 25 | receiver: bar 26 | -------------------------------------------------------------------------------- /pkg/integrations/testdata/template-missing-processor.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | foo: 3 | somesetting: ${var:somevalue} 4 | bar: 5 | somecomplexsetting: 6 | someobject: 7 | value: ${var:value} 8 | other: ${var:othervalue} 9 | 10 | processors: 11 | someprocessor: 12 | otherprocessor: 13 | third: 14 | option: ${var:option} 15 | 16 | pipelines: 17 | metrics: 18 | receiver: foo 19 | processors: [someprocessor, otherprocessor] 20 | logs: 21 | receiver: bar 22 | processors: 23 | - third/missing 24 | logs/raw: 25 | receiver: bar 26 | -------------------------------------------------------------------------------- /pkg/integrations/testdata/template-missing-receiver.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | foo: 3 | somesetting: ${var:somevalue} 4 | bar: 5 | somecomplexsetting: 6 | someobject: 7 | value: ${var:value} 8 | other: ${var:othervalue} 9 | 10 | processors: 11 | someprocessor: 12 | otherprocessor: 13 | third: 14 | option: ${var:option} 15 | 16 | pipelines: 17 | metrics: 18 | receiver: foo/missing 19 | processors: [someprocessor, otherprocessor] 20 | logs: 21 | receiver: bar 22 | processors: 23 | - third 24 | logs/raw: 25 | receiver: bar 26 | -------------------------------------------------------------------------------- /loadgen/cmd/otelbench/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.Common 2 | 3 | VERSION := v0.5.0 4 | 5 | .PHONY: get-version 6 | get-version: 7 | @echo $(VERSION) 8 | 9 | FILENAME?=$(shell git branch --show-current) 10 | .PHONY: chlog-new 11 | chlog-new: $(CHLOGGEN) # Create new changelog entry 12 | $(CHLOGGEN) new --filename $(FILENAME) 13 | 14 | .PHONY: chlog-validate 15 | chlog-validate: $(CHLOGGEN) # Validate the new changelog entry 16 | $(CHLOGGEN) validate 17 | 18 | .PHONY: chlog-preview 19 | chlog-preview: $(CHLOGGEN) # Preview the changelog entry in CHANGELOG.md 20 | $(CHLOGGEN) update --dry 21 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/skip_enrichment/metrics_false_output.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: agent.name 5 | value: 6 | stringValue: otlp 7 | - key: agent.version 8 | value: 9 | stringValue: unknown 10 | - key: service.name 11 | value: 12 | stringValue: test-service 13 | scopeMetrics: 14 | - metrics: 15 | - gauge: 16 | dataPoints: 17 | - asInt: "123" 18 | name: test_metric 19 | scope: {} 20 | -------------------------------------------------------------------------------- /distributions/elastic-components/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.21 as certs 2 | RUN apk --update add ca-certificates 3 | 4 | FROM scratch 5 | 6 | ARG USER_UID=10001 7 | USER ${USER_UID} 8 | 9 | COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt 10 | COPY --chmod=755 _build/elastic-collector-components /elastic-collector-components 11 | COPY distributions/elastic-components/config.yaml /etc/elastic-collector-components/config.yaml 12 | ENTRYPOINT ["/elastic-collector-components"] 13 | CMD ["--config", "/etc/elastic-collector-components/config.yaml"] 14 | EXPOSE 4317 55678 55679 -------------------------------------------------------------------------------- /processor/integrationprocessor/testdata/templates/multipleprocessors.yaml: -------------------------------------------------------------------------------- 1 | processors: 2 | transform/variable: 3 | log_statements: 4 | - set(log.attributes["resource"], "${var:resource}") 5 | transform/original: 6 | log_statements: 7 | - set(log.attributes["resource"], "original") 8 | transform/notused: 9 | log_statements: 10 | - set(log.attributes["notused"], "${var:not_used}") 11 | 12 | pipelines: 13 | logs: 14 | processors: 15 | - transform/original 16 | - transform/variable 17 | metrics/notused: 18 | processors: 19 | - transform/notused 20 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/elastic_hostname/spans_input.yaml: -------------------------------------------------------------------------------- 1 | resourceSpans: 2 | - resource: 3 | attributes: 4 | - key: host.hostname 5 | value: 6 | stringValue: hostname-1 7 | scopeSpans: 8 | - scope: {} 9 | spans: 10 | - attributes: 11 | - key: some.key 12 | value: 13 | stringValue: main 14 | endTimeUnixNano: "1581452773000000789" 15 | name: span-elastic-db 16 | parentSpanId: "bcff497b5a47310f" 17 | startTimeUnixNano: "1581452772000000321" 18 | 19 | -------------------------------------------------------------------------------- /pkg/integrations/testdata/template-unknown-fields.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | foo: 3 | somesetting: ${var:somevalue} 4 | bar: 5 | somecomplexsetting: 6 | someobject: 7 | value: ${var:value} 8 | other: ${var:othervalue} 9 | 10 | processors: 11 | someprocessor: 12 | otherprocessor: 13 | third: 14 | option: ${var:option} 15 | 16 | extensions: 17 | someextension: 18 | 19 | pipelines: 20 | metrics: 21 | receiver: foo 22 | processors: [someprocessor, otherprocessor] 23 | logs: 24 | receiver: bar 25 | processors: 26 | - third 27 | logs/raw: 28 | receiver: bar 29 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/testdata/invalid-json-event.ndjson: -------------------------------------------------------------------------------- 1 | {"metadata": {"user": null, "process": {"ppid": null, "pid": 1234, "argv": null, "title": null}, "system": null, "service": {"name": "1234_service-12a3", "language": {"version": null, "name":"ecmascript"}, "agent": {"version": "3.14.0", "name": "elastic-node"}, "environment": null, "framework": null,"version": null, "runtime": null}}} 2 | { "invalid-json" } 3 | {"span": {"trace_id": "fdedef0123456789abcdef9876543210", "parent_id": "abcdef0123456789","id": "abcdef01234567", "transaction_id": "01af25874dec69dd", "name": "GET /api/types", "type": "request","start": 0, "duration": 141.581 }} -------------------------------------------------------------------------------- /processor/elasticinframetricsprocessor/testdata/config.yaml: -------------------------------------------------------------------------------- 1 | elasticinframetrics: 2 | elasticinframetrics/all: 3 | add_system_metrics: true 4 | add_k8s_metrics: true 5 | 6 | elasticinframetrics/with_system_metrics: 7 | add_system_metrics: true 8 | add_k8s_metrics: false 9 | 10 | elasticinframetrics/without_system_and_k8s_metrics: 11 | add_system_metrics: false 12 | add_k8s_metrics: false 13 | 14 | elasticinframetrics/with_kubernetes_metrics: 15 | add_system_metrics: false 16 | add_k8s_metrics: true 17 | 18 | 19 | elasticinframetrics/all_and_drop_original: 20 | add_system_metrics: true 21 | add_k8s_metrics: true 22 | drop_original: true -------------------------------------------------------------------------------- /loadgen/README.md: -------------------------------------------------------------------------------- 1 | # loadgen: OTel load generation tooling 2 | 3 | In `cmd/` directory, there are 4 | - [otelsoak](./cmd/otelsoak/README.md) 5 | - Load generator that is exactly an OTel collector. It sends load to an endpoint and never terminates. 6 | - Suitable for soak testing 7 | - [otelbench](./cmd/otelbench/README.md) 8 | - Load generator based on OTel collector and Go benchmarking. It sends load to an endpoint, terminates after a configured duration, and outputs statistics. 9 | - Suitable for benchmarking 10 | 11 | otelsoak and otelbench are synonymous to apmsoak and apmbench in [elastic/apm-perf](https://github.com/elastic/apm-perf). 12 | -------------------------------------------------------------------------------- /.github/renovate.json5: -------------------------------------------------------------------------------- 1 | { 2 | extends: [ 3 | 'config:recommended', 4 | ], 5 | labels: [ 6 | 'automation', 7 | ], 8 | enabledManagers: [ 9 | 'custom.regex', 10 | ], 11 | packageRules: [ 12 | { 13 | matchManagers: [ 14 | 'custom.regex', 15 | ], 16 | groupName: 'otelcol', 17 | }, 18 | ], 19 | customManagers: [ 20 | { 21 | customType: 'regex', 22 | fileMatch: [ 23 | 'distributions/elastic-components/manifest.yaml$', 24 | ], 25 | datasourceTemplate: 'go', 26 | matchStrings: [ 27 | 'gomod: (?.+) (?.+)', 28 | ], 29 | }, 30 | ], 31 | } 32 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/merger/single_metric/output.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: res.1 5 | value: 6 | stringValue: val.1 7 | scopeMetrics: 8 | - metrics: 9 | - name: delta.monotonic.sum.1 10 | sum: 11 | aggregationTemporality: 1 12 | dataPoints: 13 | - asDouble: 999 14 | attributes: 15 | - key: dp.1 16 | value: 17 | stringValue: val.1 18 | timeUnixNano: "8000000" 19 | isMonotonic: true 20 | scope: 21 | name: scope.1 22 | -------------------------------------------------------------------------------- /processor/elasticinframetricsprocessor/testdata/k8smetrics/input-metrics.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: k8s.pod.name 5 | value: 6 | stringValue: test-pod 7 | schemaUrl: https://test-res-schema.com/schema 8 | scopeMetrics: 9 | - metrics: 10 | - gauge: 11 | dataPoints: 12 | - asDouble: 345 13 | timeUnixNano: "1000000" 14 | name: k8s.pod.cpu_limit_utilization 15 | schemaUrl: https://test-scope-schema.com/schema 16 | scope: 17 | name: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kubeletstatsreceiver 18 | version: 1.2.3 19 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 2 3 | updates: 4 | - package-ecosystem: "gomod" 5 | directories: 6 | - "**/*" 7 | schedule: 8 | interval: "daily" 9 | labels: 10 | - automation 11 | groups: 12 | otel-dependencies: 13 | patterns: 14 | - "go.opentelemetry.io/*" 15 | - "github.com/open-telemetry/opentelemetry-collector-contrib/*" 16 | - "github.com/elastic/opentelemetry-lib" 17 | ignore: 18 | - dependency-name: "*" 19 | update-types: ["version-update:semver-major"] 20 | 21 | - package-ecosystem: "github-actions" 22 | directory: "/" 23 | schedule: 24 | interval: "daily" 25 | labels: 26 | - automation 27 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/skip_enrichment/logs_false_ecs_output.yaml: -------------------------------------------------------------------------------- 1 | resourceLogs: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: test-service 7 | - key: data_stream.type 8 | value: 9 | stringValue: logs 10 | - key: data_stream.dataset 11 | value: 12 | stringValue: apm 13 | - key: data_stream.namespace 14 | value: 15 | stringValue: default 16 | - key: agent.name 17 | value: 18 | stringValue: otlp 19 | scopeLogs: 20 | - logRecords: 21 | - body: 22 | stringValue: test log message 23 | scope: {} 24 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/skip_enrichment/logs_true_ecs_output.yaml: -------------------------------------------------------------------------------- 1 | resourceLogs: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: test-service 7 | - key: data_stream.type 8 | value: 9 | stringValue: logs 10 | - key: data_stream.dataset 11 | value: 12 | stringValue: apm 13 | - key: data_stream.namespace 14 | value: 15 | stringValue: default 16 | - key: agent.name 17 | value: 18 | stringValue: otlp 19 | scopeLogs: 20 | - logRecords: 21 | - body: 22 | stringValue: test log message 23 | scope: {} 24 | -------------------------------------------------------------------------------- /processor/elasticinframetricsprocessor/testdata/k8smetrics_drop_original/input-metrics.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: k8s.pod.name 5 | value: 6 | stringValue: test-pod 7 | schemaUrl: https://test-res-schema.com/schema 8 | scopeMetrics: 9 | - metrics: 10 | - gauge: 11 | dataPoints: 12 | - asDouble: 345 13 | timeUnixNano: "1000000" 14 | name: k8s.pod.cpu_limit_utilization 15 | schemaUrl: https://test-scope-schema.com/schema 16 | scope: 17 | name: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kubeletstatsreceiver 18 | version: 1.2.3 19 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/testdata/multiple_histogram_metrics_samples.ndjson: -------------------------------------------------------------------------------- 1 | {"metadata": {"service": {"name": "my-service", "version": "1.0.0", "agent": {"version": "3.14.0", "name": "elastic-node"}}}} 2 | {"metricset": {"samples": {"valid_histogram_metric_1": {"type": "histogram", "unit": "ms", "counts": [1, 3, 5], "values": [10, 20, 30]}}, "timestamp": 1757462026684385}} 3 | {"metricset": {"samples": {"valid_histogram_metric_2": {"type": "histogram", "unit": "ms", "counts": [2, 4, 6, 8, 10], "values": [5, 10, 15, 25, 50]}}, "timestamp": 1757462026684385}} 4 | {"metricset": {"samples": {"value_count_mismatch_histogram_metric": {"type": "histogram", "unit": "ms", "counts": [1, 2, 3], "values": [10, 20]}}, "timestamp": 1757462026684385}} 5 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/elastic_apm/logs_output.yaml: -------------------------------------------------------------------------------- 1 | resourceLogs: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: test-service 7 | - key: data_stream.type 8 | value: 9 | stringValue: logs 10 | - key: data_stream.dataset 11 | value: 12 | stringValue: apm.app.test_service 13 | - key: data_stream.namespace 14 | value: 15 | stringValue: default 16 | - key: agent.name 17 | value: 18 | stringValue: otlp 19 | scopeLogs: 20 | - logRecords: 21 | - body: 22 | stringValue: test log message 23 | scope: {} 24 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/testdata/language_name_mapping.ndjson: -------------------------------------------------------------------------------- 1 | {"metadata": {"service": {"name": "1234_service-12a3","node": {"configured_name": "node-123"},"version": "5.1.3","environment": "staging","language": {"name": "C#","version": "5"}, "agent": {"name": "elastic-dotnet", "activation_method": "some_activation_method","version": "3.14.0"}}, "system": {"architecture": "x64","platform": "darwin", "container": {"id": "container-id"}}}} 2 | {"transaction": { "id": "945254c567a5417e", "trace_id": "0123456789abcdef0123456789abcdef", "parent_id": "abcdefabcdef01234567", "type": "request", "duration": 32.592981, "timestamp": 1496170407154000, "span_count": { "started": 43 }, "otel": { "attributes" : { "elastic.profiler_stack_trace_ids" : ["foo", "bar", "foo"]}}}} 3 | -------------------------------------------------------------------------------- /receiver/integrationreceiver/testdata/templates/filelog.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | filelog: 3 | include: ${var:paths} 4 | start_at: beginning 5 | undefined: 6 | 7 | processors: 8 | transform/variable: 9 | log_statements: 10 | - set(log.attributes["resource"], "${var:resource}") 11 | transform/original: 12 | log_statements: 13 | - set(log.attributes["resource"], "original") 14 | transform/notused: 15 | log_statements: 16 | - set(log.attributes["notused"], "${var:not_used}") 17 | 18 | pipelines: 19 | logs: 20 | receiver: filelog 21 | 22 | logs/processed: 23 | receiver: filelog 24 | processors: 25 | - transform/original 26 | - transform/variable 27 | 28 | logs/undefined: 29 | receiver: undefined 30 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/testdata/span-links.ndjson: -------------------------------------------------------------------------------- 1 | {"metadata": { "service": {"name": "1234_service-12a3", "agent": {"version": "3.14.0", "name": "elastic-node"}}}} 2 | {"span": {"id": "0123456a89012345", "trace_id": "0123456789abcdef0123456789abcdef", "parent_id": "ab23456a89012345", "name": "GET /api/types", "type": "request", "start": 1.845, "duration": 3.5642981, "links": [{"span_id": "1123456a89012345", "trace_id": "13234567890123456789abcdefabcdef"}]}} 3 | {"transaction": {"trace_id": "01234567890123456789abcdefabcdef", "id": "abcdef1478523690", "type": "request", "duration": 32.592981, "span_count": {"started": 0}, "links": [{"span_id": "1123456a89012345", "trace_id": "45234567890123456789abcdefabcdef"}, {"span_id": "1123456a89012346", "trace_id": "45234567890123456789abcdefabcdef"}]}} -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/logs/service_summary/input.yaml: -------------------------------------------------------------------------------- 1 | resourceLogs: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: foo 7 | - key: deployment.environment 8 | value: 9 | stringValue: qa 10 | - key: telemetry.sdk.language 11 | value: 12 | stringValue: go 13 | - key: foo 14 | value: 15 | stringValue: bar 16 | scopeLogs: 17 | - scope: {} 18 | logRecords: 19 | - body: 20 | stringValue: This is a log message 21 | timeUnixNano: "1581452773000000789" 22 | attributes: 23 | - key: log.foo 24 | value: 25 | stringValue: log.bar 26 | -------------------------------------------------------------------------------- /loadgen/cmd/otelbench/.chloggen/TEMPLATE.yaml: -------------------------------------------------------------------------------- 1 | # Use this changelog template to create an entry for release notes. 2 | 3 | # One of 'breaking', 'deprecation', 'enhancement', 'bug_fix' 4 | change_type: 5 | 6 | # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). 7 | note: 8 | 9 | # It is mandatory to specify the component. Do not change this. 10 | component: otelbench 11 | 12 | # Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. 13 | issues: [] 14 | 15 | # (Optional) One or more lines of additional information to render under the primary note. 16 | # These lines will be padded with 2 spaces and then inserted directly into the document. 17 | # Use pipe (|) for multiline entries. 18 | subtext: -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/testdata/invalid-event.ndjson: -------------------------------------------------------------------------------- 1 | {"metadata": {"user": null, "process": {"ppid": null, "pid": 1234, "argv": null, "title": null}, "system": null, "service": {"name": "1234_service-12a3", "language": {"version": null, "name":"ecmascript"}, "agent": {"version": "3.14.0", "name": "elastic-node"}, "environment": null, "framework": null,"version": null, "runtime": null}}} 2 | { "transaction": { "id": 12345, "trace_id": "0123456789abcdef0123456789abcdef", "parent_id": "abcdefabcdef01234567", "type": "request", "duration": 32.592981, "span_count": { "started": 21 } } } 3 | {"span": {"trace_id": "fdedef0123456789abcdef9876543210", "parent_id": "abcdef0123456789","id": "abcdef01234567", "transaction_id": "01af25874dec69dd", "name": "GET /api/types", "type": "request","start": 0, "duration": 141.581 }} -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/logs/service_summary_custom_attrs/input.yaml: -------------------------------------------------------------------------------- 1 | resourceLogs: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: foo 7 | - key: deployment.environment 8 | value: 9 | stringValue: qa 10 | - key: telemetry.sdk.language 11 | value: 12 | stringValue: go 13 | - key: foo 14 | value: 15 | stringValue: bar 16 | scopeLogs: 17 | - scope: {} 18 | logRecords: 19 | - body: 20 | stringValue: This is a log message 21 | timeUnixNano: "1581452773000000789" 22 | attributes: 23 | - key: log.foo 24 | value: 25 | stringValue: log.bar 26 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/logs/service_summary_no_overflow/input.yaml: -------------------------------------------------------------------------------- 1 | resourceLogs: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: foo 7 | - key: deployment.environment 8 | value: 9 | stringValue: qa 10 | - key: telemetry.sdk.language 11 | value: 12 | stringValue: go 13 | - key: foo 14 | value: 15 | stringValue: bar 16 | scopeLogs: 17 | - scope: {} 18 | logRecords: 19 | - body: 20 | stringValue: This is a log message 21 | timeUnixNano: "1581452773000000789" 22 | attributes: 23 | - key: log.foo 24 | value: 25 | stringValue: log.bar 26 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/metrics/service_summary/input.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: foo 7 | - key: deployment.environment 8 | value: 9 | stringValue: qa 10 | - key: telemetry.sdk.language 11 | value: 12 | stringValue: go 13 | - key: foo 14 | value: 15 | stringValue: bar 16 | scopeMetrics: 17 | - scope: {} 18 | metrics: 19 | - name: foo 20 | sum: 21 | dataPoints: 22 | - asInt: 1 23 | attributes: 24 | - key: dp.foo 25 | value: 26 | stringValue: dp.bar 27 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/metrics/service_summary_custom_attrs/input.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: foo 7 | - key: deployment.environment 8 | value: 9 | stringValue: qa 10 | - key: telemetry.sdk.language 11 | value: 12 | stringValue: go 13 | - key: foo 14 | value: 15 | stringValue: bar 16 | scopeMetrics: 17 | - scope: {} 18 | metrics: 19 | - name: foo 20 | sum: 21 | dataPoints: 22 | - asInt: 1 23 | attributes: 24 | - key: dp.foo 25 | value: 26 | stringValue: dp.bar 27 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/metrics/service_summary_no_overflow/input.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: foo 7 | - key: deployment.environment 8 | value: 9 | stringValue: qa 10 | - key: telemetry.sdk.language 11 | value: 12 | stringValue: go 13 | - key: foo 14 | value: 15 | stringValue: bar 16 | scopeMetrics: 17 | - scope: {} 18 | metrics: 19 | - name: foo 20 | sum: 21 | dataPoints: 22 | - asInt: 1 23 | attributes: 24 | - key: dp.foo 25 | value: 26 | stringValue: dp.bar 27 | -------------------------------------------------------------------------------- /receiver/integrationreceiver/testdata/expected-logs-no-processing.yaml: -------------------------------------------------------------------------------- 1 | resourceLogs: 2 | - resource: {} 3 | scopeLogs: 4 | - logRecords: 5 | - attributes: 6 | - key: log.file.name 7 | value: 8 | stringValue: test-simple.log 9 | body: 10 | stringValue: this is a log 11 | observedTimeUnixNano: "1741199236709530497" 12 | spanId: "" 13 | traceId: "" 14 | - attributes: 15 | - key: log.file.name 16 | value: 17 | stringValue: test-simple.log 18 | body: 19 | stringValue: this is another log 20 | observedTimeUnixNano: "1741199236709532510" 21 | spanId: "" 22 | traceId: "" 23 | scope: {} 24 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/testdata/hostdata.ndjson: -------------------------------------------------------------------------------- 1 | {"metadata": {"service":{"agent":{"name":"dotnet","version":"1.30.2-canary.0.4+3386ba62c316b311cf1da30278ce927a6735f2ce","activation_method":"nuget"},"environment":"Production","framework":{"name":"ASP.NET Core","version":"8.0.0.0"},"language":{"name":"C#"},"name":"SampleAspNetCoreApp","node":{},"runtime":{"name":".NET 8","version":"8.0.5"}},"process":{"pid":63039,"title":"SampleAspNetCor"},"system":{"detected_hostname":"gregs-mbp-2","hostname":"deprecated_hostname"}}} 2 | {"transaction": { "id": "945254c567a5417e", "trace_id": "0123456789abcdef0123456789abcdef", "parent_id": "abcdefabcdef01234567", "type": "request", "duration": 32.592981, "timestamp": 1496170407154000, "span_count": { "started": 43 }, "otel": { "attributes" : { "elastic.profiler_stack_trace_ids" : ["foo", "bar", "foo"]}}}} -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/skip_enrichment/metrics_false_ecs_output.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: agent.name 5 | value: 6 | stringValue: otlp 7 | - key: agent.version 8 | value: 9 | stringValue: unknown 10 | - key: data_stream.dataset 11 | value: 12 | stringValue: apm 13 | - key: data_stream.namespace 14 | value: 15 | stringValue: default 16 | - key: data_stream.type 17 | value: 18 | stringValue: metrics 19 | - key: service.name 20 | value: 21 | stringValue: test-service 22 | scopeMetrics: 23 | - metrics: 24 | - gauge: 25 | dataPoints: 26 | - asInt: "123" 27 | name: test_metric 28 | scope: {} 29 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/skip_enrichment/metrics_true_ecs_output.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: agent.name 5 | value: 6 | stringValue: otlp 7 | - key: agent.version 8 | value: 9 | stringValue: unknown 10 | - key: data_stream.dataset 11 | value: 12 | stringValue: apm 13 | - key: data_stream.namespace 14 | value: 15 | stringValue: default 16 | - key: data_stream.type 17 | value: 18 | stringValue: metrics 19 | - key: service.name 20 | value: 21 | stringValue: test-service 22 | scopeMetrics: 23 | - metrics: 24 | - gauge: 25 | dataPoints: 26 | - asInt: "123" 27 | name: test_metric 28 | scope: {} 29 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/elastic_apm/metrics_output.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: agent.name 5 | value: 6 | stringValue: otlp 7 | - key: agent.version 8 | value: 9 | stringValue: unknown 10 | - key: data_stream.dataset 11 | value: 12 | stringValue: apm.app.test_service 13 | - key: data_stream.namespace 14 | value: 15 | stringValue: default 16 | - key: data_stream.type 17 | value: 18 | stringValue: metrics 19 | - key: service.name 20 | value: 21 | stringValue: test-service 22 | scopeMetrics: 23 | - metrics: 24 | - gauge: 25 | dataPoints: 26 | - asInt: "123" 27 | name: test_metric 28 | scope: {} 29 | -------------------------------------------------------------------------------- /internal/tools/empty_test.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package tools 19 | -------------------------------------------------------------------------------- /.github/workflows/scripts/create_pr.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | VERSION=$1 5 | GITHUB_EVENT_NAME=$2 6 | BRANCH_NAME="update-changelog-$VERSION-$(date +%F_%H-%M-%S)" 7 | 8 | ( 9 | cd ./loadgen/cmd/otelbench 10 | chloggen update --version $VERSION 11 | 12 | if [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then 13 | # update version inside Makefile 14 | sed -i "s/^VERSION := .*/VERSION := $VERSION/" Makefile 15 | fi 16 | ) 17 | 18 | # commit changes 19 | git checkout -b "$BRANCH_NAME" 20 | git add ./loadgen/cmd/otelbench 21 | if ! git diff --staged --quiet; then 22 | git commit -m "Update otelbench changelog and delete changelog fragments." 23 | git push origin "$BRANCH_NAME" 24 | else 25 | echo "No changes to commit." 26 | exit 0 27 | fi 28 | 29 | echo "Create PR" 30 | gh pr create \ 31 | --title="[loadgen/otelbench] Update changelog for $VERSION" \ 32 | --base "main" \ 33 | --head "$BRANCH_NAME" \ 34 | -b "This PR updates the changelog and removes old changelog fragments." -------------------------------------------------------------------------------- /receiver/integrationreceiver/testdata/expected-logs-with-attributes.yaml: -------------------------------------------------------------------------------- 1 | resourceLogs: 2 | - resource: {} 3 | scopeLogs: 4 | - logRecords: 5 | - attributes: 6 | - key: log.file.name 7 | value: 8 | stringValue: test-simple.log 9 | - key: resource 10 | value: 11 | stringValue: test 12 | body: 13 | stringValue: this is a log 14 | observedTimeUnixNano: "1741200622991237029" 15 | spanId: "" 16 | traceId: "" 17 | - attributes: 18 | - key: log.file.name 19 | value: 20 | stringValue: test-simple.log 21 | - key: resource 22 | value: 23 | stringValue: test 24 | body: 25 | stringValue: this is another log 26 | observedTimeUnixNano: "1741200622991239294" 27 | spanId: "" 28 | traceId: "" 29 | scope: {} 30 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/elastic_hostname/logs_output.yaml: -------------------------------------------------------------------------------- 1 | resourceLogs: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: test-service 7 | - key: data_stream.type 8 | value: 9 | stringValue: logs 10 | - key: data_stream.dataset 11 | value: 12 | stringValue: apm.app.test_service 13 | - key: data_stream.namespace 14 | value: 15 | stringValue: default 16 | - key: agent.name 17 | value: 18 | stringValue: otlp 19 | - key: service.instance.id 20 | value: 21 | stringValue: hostname-1 22 | - key: host.name 23 | value: 24 | stringValue: hostname-1 25 | - key: host.hostname 26 | value: 27 | stringValue: hostname-1 28 | scopeSpans: 29 | scopeLogs: 30 | - logRecords: 31 | - body: 32 | stringValue: test log message 33 | scope: {} 34 | -------------------------------------------------------------------------------- /receiver/loadgenreceiver/doc.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | //go:generate mdatagen metadata.yaml 19 | 20 | package loadgenreceiver // import "github.com/elastic/opentelemetry-collector-components/receiver/loadgenreceiver" 21 | -------------------------------------------------------------------------------- /extension/apikeyauthextension/doc.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | //go:generate mdatagen metadata.yaml 19 | 20 | package apikeyauthextension // import "github.com/elastic/opentelemetry-collector-components/extension/apikeyauthextension" 21 | -------------------------------------------------------------------------------- /extension/apmconfigextension/doc.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | //go:generate mdatagen metadata.yaml 19 | 20 | package apmconfigextension // import "github.com/elastic/opentelemetry-collector-components/extension/apmconfigextension" 21 | -------------------------------------------------------------------------------- /processor/ratelimitprocessor/doc.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | //go:generate mdatagen metadata.yaml 19 | 20 | package ratelimitprocessor // import "github.com/elastic/opentelemetry-collector-components/processor/ratelimitprocessor" 21 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/metrics/service_summary_overflow/input.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: foo 7 | - key: deployment.environment 8 | value: 9 | stringValue: qa 10 | - key: telemetry.sdk.language 11 | value: 12 | stringValue: go 13 | scopeMetrics: 14 | - scope: {} 15 | metrics: 16 | - name: foo 17 | sum: 18 | dataPoints: 19 | - asInt: 1 20 | - resource: 21 | attributes: 22 | - key: service.name 23 | value: 24 | stringValue: bar 25 | - key: deployment.environment 26 | value: 27 | stringValue: qa 28 | - key: telemetry.sdk.language 29 | value: 30 | stringValue: go 31 | scopeMetrics: 32 | - scope: {} 33 | metrics: 34 | - name: foo 35 | sum: 36 | dataPoints: 37 | - asInt: 1 -------------------------------------------------------------------------------- /extension/clientaddrmiddlewareextension/doc.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | //go:generate mdatagen metadata.yaml 19 | 20 | package clientaddrmiddlewareextension // import "github.com/elastic/opentelemetry-collector-components/extension/clientaddrmiddlewareextension" 21 | -------------------------------------------------------------------------------- /processor/elasticinframetricsprocessor/doc.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | //go:generate mdatagen metadata.yaml 19 | 20 | package elasticinframetricsprocessor // import "github.com/elastic/opentelemetry-collector-components/processor/elasticinframetricsprocessor" 21 | -------------------------------------------------------------------------------- /receiver/loadgenreceiver/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package loadgenreceiver 21 | 22 | import ( 23 | "testing" 24 | 25 | "go.uber.org/goleak" 26 | ) 27 | 28 | func TestMain(m *testing.M) { 29 | goleak.VerifyTestMain(m) 30 | } 31 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package elasticapmconnector 21 | 22 | import ( 23 | "testing" 24 | 25 | "go.uber.org/goleak" 26 | ) 27 | 28 | func TestMain(m *testing.M) { 29 | goleak.VerifyTestMain(m) 30 | } 31 | -------------------------------------------------------------------------------- /extension/apikeyauthextension/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package apikeyauthextension 21 | 22 | import ( 23 | "testing" 24 | 25 | "go.uber.org/goleak" 26 | ) 27 | 28 | func TestMain(m *testing.M) { 29 | goleak.VerifyTestMain(m) 30 | } 31 | -------------------------------------------------------------------------------- /extension/apmconfigextension/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package apmconfigextension 21 | 22 | import ( 23 | "testing" 24 | 25 | "go.uber.org/goleak" 26 | ) 27 | 28 | func TestMain(m *testing.M) { 29 | goleak.VerifyTestMain(m) 30 | } 31 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package elasticapmprocessor 21 | 22 | import ( 23 | "testing" 24 | 25 | "go.uber.org/goleak" 26 | ) 27 | 28 | func TestMain(m *testing.M) { 29 | goleak.VerifyTestMain(m) 30 | } 31 | -------------------------------------------------------------------------------- /processor/ratelimitprocessor/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package ratelimitprocessor 21 | 22 | import ( 23 | "testing" 24 | 25 | "go.uber.org/goleak" 26 | ) 27 | 28 | func TestMain(m *testing.M) { 29 | goleak.VerifyTestMain(m) 30 | } 31 | -------------------------------------------------------------------------------- /receiver/integrationreceiver/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package integrationreceiver 21 | 22 | import ( 23 | "testing" 24 | 25 | "go.uber.org/goleak" 26 | ) 27 | 28 | func TestMain(m *testing.M) { 29 | goleak.VerifyTestMain(m) 30 | } 31 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/doc.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | //go:generate mdatagen metadata.yaml 19 | 20 | // Package elasticapmprocessor enriches the traces with Elastic specific attributes. 21 | package elasticapmprocessor // import "github.com/elastic/opentelemetry-collector-components/processor/elasticapmprocessor" 22 | -------------------------------------------------------------------------------- /processor/elastictraceprocessor/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package elastictraceprocessor 21 | 22 | import ( 23 | "testing" 24 | 25 | "go.uber.org/goleak" 26 | ) 27 | 28 | func TestMain(m *testing.M) { 29 | goleak.VerifyTestMain(m) 30 | } 31 | -------------------------------------------------------------------------------- /processor/integrationprocessor/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package integrationprocessor 21 | 22 | import ( 23 | "testing" 24 | 25 | "go.uber.org/goleak" 26 | ) 27 | 28 | func TestMain(m *testing.M) { 29 | goleak.VerifyTestMain(m) 30 | } 31 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package lsmintervalprocessor 21 | 22 | import ( 23 | "testing" 24 | 25 | "go.uber.org/goleak" 26 | ) 27 | 28 | func TestMain(m *testing.M) { 29 | goleak.VerifyTestMain(m) 30 | } 31 | -------------------------------------------------------------------------------- /extension/fileintegrationextension/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package fileintegrationextension 21 | 22 | import ( 23 | "testing" 24 | 25 | "go.uber.org/goleak" 26 | ) 27 | 28 | func TestMain(m *testing.M) { 29 | goleak.VerifyTestMain(m) 30 | } 31 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package elasticapmintakereceiver 21 | 22 | import ( 23 | "testing" 24 | 25 | "go.uber.org/goleak" 26 | ) 27 | 28 | func TestMain(m *testing.M) { 29 | goleak.VerifyTestMain(m) 30 | } 31 | -------------------------------------------------------------------------------- /connector/profilingmetricsconnector/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package profilingmetricsconnector 21 | 22 | import ( 23 | "testing" 24 | 25 | "go.uber.org/goleak" 26 | ) 27 | 28 | func TestMain(m *testing.M) { 29 | goleak.VerifyTestMain(m) 30 | } 31 | -------------------------------------------------------------------------------- /extension/configintegrationextension/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package configintegrationextension 21 | 22 | import ( 23 | "testing" 24 | 25 | "go.uber.org/goleak" 26 | ) 27 | 28 | func TestMain(m *testing.M) { 29 | goleak.VerifyTestMain(m) 30 | } 31 | -------------------------------------------------------------------------------- /extension/clientaddrmiddlewareextension/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package clientaddrmiddlewareextension 21 | 22 | import ( 23 | "testing" 24 | 25 | "go.uber.org/goleak" 26 | ) 27 | 28 | func TestMain(m *testing.M) { 29 | goleak.VerifyTestMain(m) 30 | } 31 | -------------------------------------------------------------------------------- /internal/sharedcomponent/package_test.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Copyright The OpenTelemetry Authors 19 | // SPDX-License-Identifier: Apache-2.0 20 | 21 | package sharedcomponent 22 | 23 | import ( 24 | "testing" 25 | 26 | "go.uber.org/goleak" 27 | ) 28 | 29 | func TestMain(m *testing.M) { 30 | goleak.VerifyTestMain(m) 31 | } 32 | -------------------------------------------------------------------------------- /processor/elasticinframetricsprocessor/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package elasticinframetricsprocessor 21 | 22 | import ( 23 | "testing" 24 | 25 | "go.uber.org/goleak" 26 | ) 27 | 28 | func TestMain(m *testing.M) { 29 | goleak.VerifyTestMain(m) 30 | } 31 | -------------------------------------------------------------------------------- /processor/integrationprocessor/doc.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | //go:generate mdatagen metadata.yaml 19 | 20 | // Package integrationprocessor provides a processor that creates processors from integrations. 21 | package integrationprocessor // import "github.com/elastic/opentelemetry-collector-components/processor/integrationprocessor" 22 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/doc.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | //go:generate mdatagen metadata.yaml 19 | 20 | // Package elasticapmintakereceiver implements a receiver for the Elastic APM agent protocol. 21 | package elasticapmintakereceiver // import "github.com/elastic/opentelemetry-collector-components/receiver/elasticapmintakereceiver" 22 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/doc.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | //go:generate mdatagen metadata.yaml 19 | 20 | // Package elasticapmconnector provides a connector for performing Elastic APM-specific enrichment pre-aggregation. 21 | package elasticapmconnector // import "github.com/elastic/opentelemetry-collector-components/connector/elasticapmconnector" 22 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/testdata/logs/service_summary_overflow/input.yaml: -------------------------------------------------------------------------------- 1 | resourceLogs: 2 | - resource: 3 | attributes: 4 | - key: service.name 5 | value: 6 | stringValue: foo 7 | - key: deployment.environment 8 | value: 9 | stringValue: qa 10 | - key: telemetry.sdk.language 11 | value: 12 | stringValue: go 13 | scopeLogs: 14 | - scope: 15 | name: my.library1 16 | logRecords: 17 | - body: 18 | stringValue: This is a log message 19 | timeUnixNano: "1581452773000000789" 20 | - resource: 21 | attributes: 22 | - key: service.name 23 | value: 24 | stringValue: bar 25 | - key: deployment.environment 26 | value: 27 | stringValue: qa 28 | - key: telemetry.sdk.language 29 | value: 30 | stringValue: go 31 | scopeLogs: 32 | - scope: 33 | name: my.library1 34 | logRecords: 35 | - body: 36 | stringValue: This is a log message 37 | timeUnixNano: "1581452773000000789" 38 | 39 | -------------------------------------------------------------------------------- /connector/profilingmetricsconnector/doc.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | //go:generate mdatagen metadata.yaml 19 | 20 | // Package profilingmetricsconnector provides a connector to generate metrics from profiling data. 21 | package profilingmetricsconnector // import "github.com/elastic/opentelemetry-collector-components/connector/profilingmetricsconnector" 22 | -------------------------------------------------------------------------------- /connector/profilingmetricsconnector/README.md: -------------------------------------------------------------------------------- 1 | # Profiling metrics connector 2 | 3 | The Profiling metrics connector is an opinionated OTel connector that generates OTel metrics from selected OTel profiling data. 4 | 5 | ## Configuration 6 | 7 | Any [generated metric](./metadata.yaml) can be disabled through the configuration. For example: 8 | 9 | ``` 10 | metrics: 11 | samples.classification: 12 | enabled: false 13 | samples.dotnet.count: 14 | enabled: false 15 | ``` 16 | 17 | **⚠️ Configuration Warning: Metric Dependencies** 18 | 19 | To ensure data integrity and accurate ratio calculations, adhere to the following rules: 20 | - Required Combination: You must enable `samples.kernel.count` and `samples.user.count`. Their sum is the only reliable way to calculate the total sample count. 21 | - Frame metrics: Avoid disabling specific frame metrics like `samples.native.count`. Disabling these results in a loss of information regarding shared libraries. 22 | 23 | 24 | [Quickstart guide](https://www.elastic.co/docs/reference/edot-collector/config/configure-profiles-collection) to use this connector as part of [EDOT](https://www.elastic.co/docs/reference/opentelemetry). 25 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/elastic_hostname/metrics_output.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: agent.name 5 | value: 6 | stringValue: otlp 7 | - key: agent.version 8 | value: 9 | stringValue: unknown 10 | - key: data_stream.dataset 11 | value: 12 | stringValue: apm 13 | - key: data_stream.namespace 14 | value: 15 | stringValue: default 16 | - key: data_stream.type 17 | value: 18 | stringValue: metrics 19 | - key: service.name 20 | value: 21 | stringValue: test-service 22 | - key: service.instance.id 23 | value: 24 | stringValue: hostname-1 25 | - key: host.name 26 | value: 27 | stringValue: hostname-1 28 | - key: host.hostname 29 | value: 30 | stringValue: hostname-1 31 | scopeSpans: 32 | scopeMetrics: 33 | - metrics: 34 | - gauge: 35 | dataPoints: 36 | - asInt: "123" 37 | name: test_metric 38 | scope: {} 39 | -------------------------------------------------------------------------------- /receiver/integrationreceiver/doc.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | //go:generate mdatagen metadata.yaml 19 | 20 | // Package integrationreceiver provides a stateless span metrics connector similar to the upstream span metrics connector. 21 | package integrationreceiver // import "github.com/elastic/opentelemetry-collector-components/receiver/integrationreceiver" 22 | -------------------------------------------------------------------------------- /extension/clientaddrmiddlewareextension/README.md: -------------------------------------------------------------------------------- 1 | # Client Address Middleware Extension 2 | 3 | The client address server middleware provides the ability to set the [`client.Info.Addr`](https://github.com/open-telemetry/opentelemetry-collector/blob/client/v1.47.0/client/client.go#L95) based on the following metadata keys: 4 | - `forwarded` 5 | - `x-real-ip` 6 | - `x-forwarded-for` 7 | 8 | Keys are processed in the above order, the first valid value is used to set the client address. If there are no valid addresses found, the client address is not updated. 9 | 10 | ## Configuration 11 | Receivers should be configured with `include_metadata: true`, so that the context includes client metadata keys. 12 | 13 | ### Example 14 | The following example configures both the otlp `grpc` and `http` receivers with the client address middleware. 15 | ```yaml 16 | extensions: 17 | clientaddrmiddleware: {} 18 | 19 | receivers: 20 | otlp: 21 | protocols: 22 | http: 23 | include_metadata: true 24 | middlewares: 25 | - id: clientaddrmiddleware 26 | grpc: 27 | include_metadata: true 28 | middlewares: 29 | - id: clientaddrmiddleware 30 | ``` -------------------------------------------------------------------------------- /extension/fileintegrationextension/doc.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | //go:generate mdatagen metadata.yaml 19 | 20 | // Package fileintegrationextension provides a source of integrations that obtain them from a local directory. 21 | package fileintegrationextension // import "github.com/elastic/opentelemetry-collector-components/extension/fileintegrationextension" 22 | -------------------------------------------------------------------------------- /extension/configintegrationextension/doc.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | //go:generate mdatagen metadata.yaml 19 | 20 | // Package configintegrationextension provides a source of integrations that obtain them from a local directory. 21 | package configintegrationextension // import "github.com/elastic/opentelemetry-collector-components/extension/configintegrationextension" 22 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/internal/sharedcomponent/package_test.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Copyright The OpenTelemetry Authors 19 | // SPDX-License-Identifier: Apache-2.0 20 | 21 | package sharedcomponent 22 | 23 | import ( 24 | "testing" 25 | 26 | "go.uber.org/goleak" 27 | ) 28 | 29 | func TestMain(m *testing.M) { 30 | goleak.VerifyTestMain(m) 31 | } 32 | -------------------------------------------------------------------------------- /extension/clientaddrmiddlewareextension/config.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package clientaddrmiddlewareextension // import "github.com/elastic/opentelemetry-collector-components/extension/clientaddrmiddlewareextension" 19 | 20 | import ( 21 | "go.opentelemetry.io/collector/component" 22 | ) 23 | 24 | type Config struct { 25 | } 26 | 27 | func createDefaultConfig() component.Config { 28 | return &Config{} 29 | } 30 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/doc.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | //go:generate mdatagen metadata.yaml 19 | 20 | // package lsmintervalprocessor implements a processor which aggregates 21 | // metrics over time, backed by db for persistence, and periodically 22 | // exports the latest values. 23 | package lsmintervalprocessor // import "github.com/elastic/opentelemetry-collector-components/processor/lsmintervalprocessor" 24 | -------------------------------------------------------------------------------- /extension/apmconfigextension/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package metadata 21 | 22 | import ( 23 | "go.opentelemetry.io/collector/component" 24 | ) 25 | 26 | var ( 27 | Type = component.MustNewType("apmconfig") 28 | ScopeName = "github.com/elastic/opentelemetry-collector-components/extension/apmconfigextension" 29 | ) 30 | 31 | const ( 32 | ExtensionStability = component.StabilityLevelDevelopment 33 | ) 34 | -------------------------------------------------------------------------------- /extension/apikeyauthextension/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package metadata 21 | 22 | import ( 23 | "go.opentelemetry.io/collector/component" 24 | ) 25 | 26 | var ( 27 | Type = component.MustNewType("apikeyauth") 28 | ScopeName = "github.com/elastic/opentelemetry-collector-components/extension/apikeyauthextension" 29 | ) 30 | 31 | const ( 32 | ExtensionStability = component.StabilityLevelDevelopment 33 | ) 34 | -------------------------------------------------------------------------------- /processor/elasticinframetricsprocessor/config.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package elasticinframetricsprocessor // import "github.com/elastic/opentelemetry-collector-components/processor/elasticinframetricsprocessor" 19 | 20 | type Config struct { 21 | AddSystemMetrics bool `mapstructure:"add_system_metrics"` 22 | AddK8sMetrics bool `mapstructure:"add_k8s_metrics"` 23 | DropOriginal bool `mapstructure:"drop_original"` 24 | } 25 | 26 | func (c *Config) Validate() error { 27 | return nil 28 | } 29 | -------------------------------------------------------------------------------- /processor/elastictraceprocessor/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package metadata 21 | 22 | import ( 23 | "go.opentelemetry.io/collector/component" 24 | ) 25 | 26 | var ( 27 | Type = component.MustNewType("elastictrace") 28 | ScopeName = "github.com/elastic/opentelemetry-collector-components/processor/elastictraceprocessor" 29 | ) 30 | 31 | const ( 32 | TracesStability = component.StabilityLevelDeprecated 33 | ) 34 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package metadata 21 | 22 | import ( 23 | "go.opentelemetry.io/collector/component" 24 | ) 25 | 26 | var ( 27 | Type = component.MustNewType("lsminterval") 28 | ScopeName = "github.com/elastic/opentelemetry-collector-components/processor/lsmintervalprocessor" 29 | ) 30 | 31 | const ( 32 | MetricsStability = component.StabilityLevelDevelopment 33 | ) 34 | -------------------------------------------------------------------------------- /extension/fileintegrationextension/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package metadata 21 | 22 | import ( 23 | "go.opentelemetry.io/collector/component" 24 | ) 25 | 26 | var ( 27 | Type = component.MustNewType("file_integrations") 28 | ScopeName = "github.com/elastic/opentelemetry-collector-components/extension/fileintegrationextension" 29 | ) 30 | 31 | const ( 32 | ExtensionStability = component.StabilityLevelDevelopment 33 | ) 34 | -------------------------------------------------------------------------------- /extension/configintegrationextension/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package metadata 21 | 22 | import ( 23 | "go.opentelemetry.io/collector/component" 24 | ) 25 | 26 | var ( 27 | Type = component.MustNewType("config_integrations") 28 | ScopeName = "github.com/elastic/opentelemetry-collector-components/extension/configintegrationextension" 29 | ) 30 | 31 | const ( 32 | ExtensionStability = component.StabilityLevelDevelopment 33 | ) 34 | -------------------------------------------------------------------------------- /connector/profilingmetricsconnector/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package metadata 21 | 22 | import ( 23 | "go.opentelemetry.io/collector/component" 24 | ) 25 | 26 | var ( 27 | Type = component.MustNewType("profilingmetrics") 28 | ScopeName = "github.com/elastic/opentelemetry-collector-components/connector/profilingmetricsconnector" 29 | ) 30 | 31 | const ( 32 | ProfilesToMetricsStability = component.StabilityLevelDevelopment 33 | ) 34 | -------------------------------------------------------------------------------- /processor/elasticinframetricsprocessor/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package metadata 21 | 22 | import ( 23 | "go.opentelemetry.io/collector/component" 24 | ) 25 | 26 | var ( 27 | Type = component.MustNewType("elasticinframetrics") 28 | ScopeName = "github.com/elastic/opentelemetry-collector-components/processor/elasticinframetricsprocessor" 29 | ) 30 | 31 | const ( 32 | MetricsStability = component.StabilityLevelDeprecated 33 | ) 34 | -------------------------------------------------------------------------------- /extension/clientaddrmiddlewareextension/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package metadata 21 | 22 | import ( 23 | "go.opentelemetry.io/collector/component" 24 | ) 25 | 26 | var ( 27 | Type = component.MustNewType("clientaddrmiddleware") 28 | ScopeName = "github.com/elastic/opentelemetry-collector-components/extension/clientaddrmiddlewareextension" 29 | ) 30 | 31 | const ( 32 | ExtensionStability = component.StabilityLevelDevelopment 33 | ) 34 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/sum_delta/output.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: asdf 5 | value: 6 | stringValue: foo 7 | - key: custom_res_attr 8 | value: 9 | stringValue: res 10 | - key: dependent_attr 11 | value: 12 | stringValue: bbb-dependent 13 | schemaUrl: https://test-res-schema.com/schema 14 | scopeMetrics: 15 | - metrics: 16 | - name: delta.monotonic.sum 17 | sum: 18 | aggregationTemporality: 1 19 | dataPoints: 20 | - asDouble: 999 21 | attributes: 22 | - key: aaa 23 | value: 24 | stringValue: bbb 25 | - key: custom_dp_attr 26 | value: 27 | stringValue: dp 28 | timeUnixNano: "8000000" 29 | isMonotonic: true 30 | schemaUrl: https://test-scope-schema.com/schema 31 | scope: 32 | attributes: 33 | - key: custom_scope_attr 34 | value: 35 | stringValue: scope 36 | - key: foo 37 | value: 38 | stringValue: bar 39 | name: MyTestInstrument 40 | version: 1.2.3 41 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/sum_cumulative/output.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: asdf 5 | value: 6 | stringValue: foo 7 | - key: custom_res_attr 8 | value: 9 | stringValue: res 10 | - key: dependent_attr 11 | value: 12 | stringValue: bbb-dependent 13 | schemaUrl: https://test-res-schema.com/schema 14 | scopeMetrics: 15 | - metrics: 16 | - name: cumulative.monotonic.sum 17 | sum: 18 | aggregationTemporality: 2 19 | dataPoints: 20 | - asDouble: 444 21 | attributes: 22 | - key: aaa 23 | value: 24 | stringValue: bbb 25 | - key: custom_dp_attr 26 | value: 27 | stringValue: dp 28 | timeUnixNano: "8000000" 29 | isMonotonic: true 30 | schemaUrl: https://test-scope-schema.com/schema 31 | scope: 32 | attributes: 33 | - key: custom_scope_attr 34 | value: 35 | stringValue: scope 36 | - key: foo 37 | value: 38 | stringValue: bar 39 | name: MyTestInstrument 40 | version: 1.2.3 41 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Default owners 2 | * @elastic/otel-devs 3 | 4 | # Per-component owners 5 | loadgen @elastic/obs-ds-intake-services @elastic/obs-ds-hosted-services 6 | receiver/loadgenreceiver @elastic/obs-ds-intake-services @elastic/obs-ds-hosted-services 7 | receiver/elasticapmintakereceiver @elastic/obs-ds-intake-services @elastic/obs-ds-hosted-services @elastic/ingest-otel-data 8 | processor/elasticinframetricsprocessor @elastic/obs-infraobs-integrations 9 | processor/elasticapmprocessor @elastic/obs-ds-intake-services @elastic/obs-ds-hosted-services @elastic/ingest-otel-data 10 | processor/lsmintervalprocessor @elastic/obs-ds-intake-services @elastic/obs-ds-hosted-services 11 | processor/ratelimitprocessor @elastic/obs-ds-intake-services @elastic/obs-ds-hosted-services 12 | processor/integrationprocessor @elastic/ecosystem @elastic/ingest-otel-data 13 | connector/elasticapmconnector @elastic/obs-ds-intake-services @elastic/obs-ds-hosted-services 14 | extension/apikeyauthextension @elastic/obs-ds-intake-services @elastic/obs-ds-hosted-services 15 | extension/apmconfigextension @elastic/ingest-otel-data 16 | extension/fileintegrationextension @elastic/ecosystem @elastic/ingest-otel-data 17 | pkg/integrations @elastic/ecosystem @elastic/ingest-otel-data 18 | -------------------------------------------------------------------------------- /connector/profilingmetricsconnector/testdata/frame_metrics/output-metrics.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: {} 3 | scopeMetrics: 4 | - metrics: 5 | - description: Number of samples executing Python code (self) 6 | name: samples.cpython.count 7 | sum: 8 | aggregationTemporality: 1 9 | dataPoints: 10 | - asInt: "42" 11 | startTimeUnixNano: "1000000" 12 | isMonotonic: true 13 | unit: "1" 14 | - description: Number of samples executing Go code (self) 15 | name: samples.go.count 16 | sum: 17 | aggregationTemporality: 1 18 | dataPoints: 19 | - asInt: "1" 20 | startTimeUnixNano: "1000000" 21 | isMonotonic: true 22 | unit: "1" 23 | - description: Number of samples executing userspace code (self) 24 | name: samples.user.count 25 | sum: 26 | aggregationTemporality: 1 27 | dataPoints: 28 | - asInt: "43" 29 | startTimeUnixNano: "1000000" 30 | isMonotonic: true 31 | unit: "1" 32 | scope: 33 | name: github.com/elastic/opentelemetry-collector-components/connector/profilingmetricsconnector 34 | version: latest 35 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/internal/mappers/attribute_helper.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package mappers // import "github.com/elastic/opentelemetry-collector-components/receiver/elasticapmintakereceiver/internal/mappers" 19 | 20 | import ( 21 | "go.opentelemetry.io/collector/pdata/pcommon" 22 | ) 23 | 24 | // putNonEmptyStr puts a string attribute in the given map 25 | // only if the provided value is not empty. 26 | func putNonEmptyStr(attributes pcommon.Map, key, value string) { 27 | if value != "" { 28 | attributes.PutStr(key, value) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/merger/single_metric/input.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: res.1 5 | value: 6 | stringValue: val.1 7 | scopeMetrics: 8 | - scope: 9 | name: scope.1 10 | metrics: 11 | - name: delta.monotonic.sum.1 12 | sum: 13 | aggregationTemporality: 1 14 | isMonotonic: true 15 | dataPoints: 16 | - timeUnixNano: 5000000 17 | asDouble: 333 18 | attributes: 19 | - key: dp.1 20 | value: 21 | stringValue: val.1 22 | # This data point is out of order 23 | # The aggregator should ignore it since the first data point has a newer timestamp 24 | - timeUnixNano: 2000000 25 | asDouble: 222 26 | attributes: 27 | - key: dp.1 28 | value: 29 | stringValue: val.1 30 | # This one is the newest, so it should be the one stored 31 | - timeUnixNano: 8000000 32 | asDouble: 444 33 | attributes: 34 | - key: dp.1 35 | value: 36 | stringValue: val.1 37 | 38 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package metadata 21 | 22 | import ( 23 | "go.opentelemetry.io/collector/component" 24 | ) 25 | 26 | var ( 27 | Type = component.MustNewType("elasticapm") 28 | ScopeName = "github.com/elastic/opentelemetry-collector-components/processor/elasticapmprocessor" 29 | ) 30 | 31 | const ( 32 | TracesStability = component.StabilityLevelAlpha 33 | MetricsStability = component.StabilityLevelAlpha 34 | LogsStability = component.StabilityLevelAlpha 35 | ) 36 | -------------------------------------------------------------------------------- /receiver/loadgenreceiver/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package metadata 21 | 22 | import ( 23 | "go.opentelemetry.io/collector/component" 24 | ) 25 | 26 | var ( 27 | Type = component.MustNewType("loadgen") 28 | ScopeName = "github.com/elastic/opentelemetry-collector-components/receiver/loadgenreceiver" 29 | ) 30 | 31 | const ( 32 | MetricsStability = component.StabilityLevelDevelopment 33 | LogsStability = component.StabilityLevelDevelopment 34 | TracesStability = component.StabilityLevelDevelopment 35 | ) 36 | -------------------------------------------------------------------------------- /distributions/elastic-components/README.md: -------------------------------------------------------------------------------- 1 | # Example Distribution for the OpenTelemetry Elastic's components 2 | 3 | This distribution contains all the components from the [Elastic OpenTelemetry Collector components](https://github.com/elastic/opentelemetry-collector-components) repository. 4 | 5 | **This distribution is used to ensure compatibility between Elastic's components and the OpenTelemetry collector builder. It is not intended for public release.**. 6 | 7 | The list of components included in the public Elastic OpenTelemetry collector can be found [here](https://github.com/elastic/elastic-agent/blob/main/internal/pkg/otel/README.md). 8 | 9 | ## Contributing 10 | 11 | All components within this repository should be added in this distribution's manifest in order to ensure its integration with any OpenTelemetry Collector binary. For example, to add a receiver component named `customreceiver` and located in the root repository directory `./receiver/customreceiver`, append the following entries into the [manifest.yaml](./manifest.yaml) file: 12 | 13 | ``` 14 | receivers: 15 | - gomod: github.com/elastic/opentelemetry-collector-components/receiver/customreceiver v0.0.1 16 | 17 | ... 18 | replaces: 19 | - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/customreceiver => ../receiver/customreceiver 20 | ``` 21 | 22 | Finally, add the component into the example [distribution's configuration file](./config.yaml). 23 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package metadata 21 | 22 | import ( 23 | "go.opentelemetry.io/collector/component" 24 | ) 25 | 26 | var ( 27 | Type = component.MustNewType("elasticapmintake") 28 | ScopeName = "github.com/elastic/opentelemetry-collector-components/receiver/elasticapmintakereceiver" 29 | ) 30 | 31 | const ( 32 | MetricsStability = component.StabilityLevelAlpha 33 | LogsStability = component.StabilityLevelAlpha 34 | TracesStability = component.StabilityLevelAlpha 35 | ) 36 | -------------------------------------------------------------------------------- /processor/integrationprocessor/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package metadata 21 | 22 | import ( 23 | "go.opentelemetry.io/collector/component" 24 | ) 25 | 26 | var ( 27 | Type = component.MustNewType("integration") 28 | ScopeName = "github.com/elastic/opentelemetry-collector-components/processor/integrationprocessor" 29 | ) 30 | 31 | const ( 32 | LogsStability = component.StabilityLevelDevelopment 33 | MetricsStability = component.StabilityLevelDevelopment 34 | TracesStability = component.StabilityLevelDevelopment 35 | ) 36 | -------------------------------------------------------------------------------- /receiver/integrationreceiver/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package metadata 21 | 22 | import ( 23 | "go.opentelemetry.io/collector/component" 24 | ) 25 | 26 | var ( 27 | Type = component.MustNewType("integration") 28 | ScopeName = "github.com/elastic/opentelemetry-collector-components/receiver/integrationreceiver" 29 | ) 30 | 31 | const ( 32 | LogsStability = component.StabilityLevelDevelopment 33 | MetricsStability = component.StabilityLevelDevelopment 34 | TracesStability = component.StabilityLevelDevelopment 35 | ) 36 | -------------------------------------------------------------------------------- /connector/elasticapmconnector/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package metadata 21 | 22 | import ( 23 | "go.opentelemetry.io/collector/component" 24 | ) 25 | 26 | var ( 27 | Type = component.MustNewType("elasticapm") 28 | ScopeName = "github.com/elastic/opentelemetry-collector-components/connector/elasticapmconnector" 29 | ) 30 | 31 | const ( 32 | LogsToMetricsStability = component.StabilityLevelDevelopment 33 | MetricsToMetricsStability = component.StabilityLevelDevelopment 34 | TracesToMetricsStability = component.StabilityLevelDevelopment 35 | ) 36 | -------------------------------------------------------------------------------- /loadgen/cmd/otelsoak/README.md: -------------------------------------------------------------------------------- 1 | # otelsoak 2 | 3 | otelsoak is just an OTel collector. 4 | 5 | To generate load to an OTLP target, run Elastic collector components distro with specific pipelines to replay canned data at a configurable rate. 6 | 7 | See an example configuration at [`config.example.yaml`](./config.example.yaml). There are rate limiting and trace ID rewriting by default. 8 | 9 | ## Usage 10 | 11 | 1. Build the Elastic collector components distro by running `make genelasticcol` at the root of this repository. 12 | 2. Run `otelsoak`, which is a symlink to the collector binary. 13 | 14 | ## Example usage 15 | 16 | To override any config, use `--config` or `--set`. See [official OTel configuration documentation](https://opentelemetry.io/docs/collector/configuration/). 17 | ``` 18 | ./otelsoak --config config.example.yaml --set "exporters.otlp.endpoint=http://localhost:8200" --set "exporters.otlp.headers.Authorization=ApiKey xxx" --set "exporters.otlp.headers.X-FOO-HEADER=bar" 19 | ``` 20 | 21 | Alternatively, there's `ELASTIC_APM_SERVER_URL` and `ELASTIC_APM_API_KEY` env var handling out of the box in the example config yaml. Note that `ELASTIC_APM_SECRET_TOKEN` is NOT supported without changing `config.example.yaml`. 22 | 23 | ``` 24 | ELASTIC_APM_SERVER_URL=http://localhost:8200 ELASTIC_APM_API_KEY=some_api_key ./otelsoak --config config.example.yaml 25 | ``` 26 | 27 | It is recommended to create your own `config.yaml` from `config.example.yaml` to fit your needs. 28 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/summary_enabled/output.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: asdf 5 | value: 6 | stringValue: foo 7 | - key: custom_res_attr 8 | value: 9 | stringValue: res 10 | - key: dependent_attr 11 | value: 12 | stringValue: bbb-dependent 13 | schemaUrl: https://test-res-schema.com/schema 14 | scopeMetrics: 15 | - metrics: 16 | - name: summary.test 17 | summary: 18 | dataPoints: 19 | - attributes: 20 | - key: aaa 21 | value: 22 | stringValue: bbb 23 | - key: custom_dp_attr 24 | value: 25 | stringValue: dp 26 | count: "25" 27 | quantileValues: 28 | - quantile: 0.95 29 | value: 15 30 | startTimeUnixNano: "5000000" 31 | sum: 310 32 | timeUnixNano: "8000000" 33 | schemaUrl: https://test-scope-schema.com/schema 34 | scope: 35 | attributes: 36 | - key: custom_scope_attr 37 | value: 38 | stringValue: scope 39 | - key: foo 40 | value: 41 | stringValue: bar 42 | name: MyTestInstrument 43 | version: 1.2.3 44 | -------------------------------------------------------------------------------- /processor/ratelimitprocessor/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Code generated by mdatagen. DO NOT EDIT. 19 | 20 | package metadata 21 | 22 | import ( 23 | "go.opentelemetry.io/collector/component" 24 | ) 25 | 26 | var ( 27 | Type = component.MustNewType("ratelimit") 28 | ScopeName = "github.com/elastic/opentelemetry-collector-components/processor/ratelimitprocessor" 29 | ) 30 | 31 | const ( 32 | LogsStability = component.StabilityLevelDevelopment 33 | TracesStability = component.StabilityLevelDevelopment 34 | MetricsStability = component.StabilityLevelDevelopment 35 | ProfilesStability = component.StabilityLevelDevelopment 36 | ) 37 | -------------------------------------------------------------------------------- /extension/apmconfigextension/architecture.md: -------------------------------------------------------------------------------- 1 | # High level architecture diagram 2 | 3 | ```mermaid 4 | sequenceDiagram 5 | participant agent as Otel Agent 6 | participant ext as OpAMP Server 7 | participant db as Config fetcher 8 | participant es as Elasticsearch 9 | 10 | 11 | Note over db,es: .apm-agent-configuration 12 | par Cache 13 | db->>+es: Scroll index 14 | es->>+db: Agent Configs 15 | end 16 | 17 | 18 | Note over agent,db: Agent To Service 19 | agent->>+ext: AgentToServer{Identifing attributes} 20 | ext->>db: RemoteConfig(agent_uid) 21 | alt NO SERVCIE IDENTIFIERS 22 | db->>ext: InvalidAgentErr 23 | ext->>agent: ServerToAgent{Flag.ReportFullState} 24 | else VALID AGENT 25 | db->>ext: Config + Hash 26 | ext->>-agent: ServerToAgent{AgentRemoteConfig} 27 | end 28 | 29 | Note over agent,db: Identified service 30 | agent->>+ext: AgentToServer{RemoteConfigStatus} 31 | alt FAILED/APPLYING 32 | ext->>db: RemoteConfig(agent_uid) 33 | db->>ext: Config + Hash 34 | ext->>agent: ServerToAgent{AgentRemoteConfig} 35 | else APPLIED 36 | ext->>-agent: ServerToAgent{} 37 | end 38 | 39 | agent->>+ext: AgentToServer{} 40 | ext->>db: RemoteConfig(agent_uid) 41 | db->>ext: Config + Hash 42 | alt HASH == LAST APPLIED HASH 43 | ext->>agent: ServerToAgent{} 44 | else NEW CONFIG 45 | ext->>agent: ServerToAgent{AgentRemoteConfig} 46 | end 47 | ``` 48 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/internal/identity/doc.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Copyright The OpenTelemetry Authors 19 | // SPDX-License-Identifier: Apache-2.0 20 | 21 | // This is a copy of the internal module from opentelemetry-collector-contrib: 22 | // https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/internal/exp/metrics/identity 23 | 24 | // identity types for metrics and sample streams. 25 | // 26 | // Use the `Of*(T) -> I` functions to obtain a unique, comparable (==) and 27 | // hashable (map key) identity value I for T. 28 | package identity // import "github.com/elastic/opentelemetry-collector-components/processor/lsmintervalprocessor/internal/identity" 29 | -------------------------------------------------------------------------------- /pkg/integrations/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/elastic/opentelemetry-collector-components/pkg/integrations 2 | 3 | go 1.24.0 4 | 5 | require ( 6 | github.com/stretchr/testify v1.11.1 7 | go.opentelemetry.io/collector/component v1.46.0 8 | go.opentelemetry.io/collector/confmap v1.46.0 9 | go.opentelemetry.io/collector/pipeline v1.46.0 10 | go.uber.org/zap v1.27.0 11 | gopkg.in/yaml.v3 v3.0.1 12 | ) 13 | 14 | require ( 15 | github.com/davecgh/go-spew v1.1.1 // indirect 16 | github.com/go-viper/mapstructure/v2 v2.4.0 // indirect 17 | github.com/gobwas/glob v0.2.3 // indirect 18 | github.com/hashicorp/go-version v1.7.0 // indirect 19 | github.com/json-iterator/go v1.1.12 // indirect 20 | github.com/knadh/koanf/maps v0.1.2 // indirect 21 | github.com/knadh/koanf/providers/confmap v1.0.0 // indirect 22 | github.com/knadh/koanf/v2 v2.3.0 // indirect 23 | github.com/mitchellh/copystructure v1.2.0 // indirect 24 | github.com/mitchellh/reflectwalk v1.0.2 // indirect 25 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect 26 | github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect 27 | github.com/pmezard/go-difflib v1.0.0 // indirect 28 | go.opentelemetry.io/collector/featuregate v1.46.0 // indirect 29 | go.opentelemetry.io/collector/pdata v1.46.0 // indirect 30 | go.opentelemetry.io/otel v1.38.0 // indirect 31 | go.opentelemetry.io/otel/metric v1.38.0 // indirect 32 | go.opentelemetry.io/otel/trace v1.38.0 // indirect 33 | go.uber.org/multierr v1.11.0 // indirect 34 | go.yaml.in/yaml/v3 v3.0.4 // indirect 35 | ) 36 | -------------------------------------------------------------------------------- /.github/workflows/scripts/check_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | # This script gets the previous version from the 5 | # previous commit, by running make get-version. 6 | # Then it compares this previous version with the 7 | # new given version. If there was an increase 8 | # in version, then a release is required. 9 | 10 | GITHUB_EVENT_NAME=$1 11 | GITHUB_INPUT_VERSION=$2 12 | 13 | WORKING_DIR="../../../loadgen/cmd/otelbench" 14 | 15 | # Get new version 16 | if [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then 17 | NEW_VERSION="$GITHUB_INPUT_VERSION" 18 | else 19 | NEW_VERSION=$(make -C "$WORKING_DIR" get-version 2>/dev/null || echo "v0.0.0") 20 | fi 21 | 22 | # Get previous version 23 | PREV_VERSION="v0.0.0" 24 | if git cat-file -e HEAD~1:"$WORKING_DIR/Makefile" 2>/dev/null; then 25 | PREV_VERSION=$(git show HEAD~1:"$WORKING_DIR/Makefile" | make -f - get-version 2>/dev/null || echo "v0.0.0") 26 | fi 27 | 28 | echo "Previous version: $PREV_VERSION." 29 | echo "New version, obtained from $GITHUB_EVENT_NAME: $NEW_VERSION." 30 | echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT 31 | 32 | # Check if a release is required. 33 | # For a release to be required, the previous 34 | # version needs to be smaller than the 35 | # given one. 36 | # v0.0.0 -> v0.1.0 -> works 37 | # v0.1.0 -> v0.0.0 -> does not work 38 | if [ "$(printf "%s\n%s" "$PREV_VERSION" "$NEW_VERSION" | sort -V | head -n1)" != "$NEW_VERSION" ]; then 39 | echo "Release required: $PREV_VERSION < $NEW_VERSION." 40 | exit 0 41 | else 42 | echo "No release needed: $PREV_VERSION > $NEW_VERSION." 43 | exit 1 44 | fi 45 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/elastic_txn_db/input.yaml: -------------------------------------------------------------------------------- 1 | resourceSpans: 2 | - resource: 3 | attributes: 4 | - key: resource.required 5 | value: 6 | stringValue: foo 7 | - key: resource.optional 8 | value: 9 | stringValue: bar 10 | scopeSpans: 11 | - scope: {} 12 | spans: 13 | - attributes: 14 | - key: db.name 15 | value: 16 | stringValue: main 17 | - key: db.system 18 | value: 19 | stringValue: mysql 20 | endTimeUnixNano: "1581452773000000789" 21 | events: 22 | - attributes: 23 | - key: event.attr1 24 | value: 25 | stringValue: foo1 26 | - key: event.attr2 27 | value: 28 | stringValue: bar1 29 | name: event1 30 | timeUnixNano: "1581452773000000123" 31 | - attributes: 32 | - key: event.attr1 33 | value: 34 | stringValue: foo2 35 | - key: event.attr2 36 | value: 37 | stringValue: bar2 38 | name: event2 39 | timeUnixNano: "1581452773000000123" 40 | - name: event-with-no-attrs 41 | timeUnixNano: "1581452773000000123" 42 | name: db-elastic-txn 43 | parentSpanId: "" 44 | startTimeUnixNano: "1581452772000000321" 45 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/elastic_span_db/input.yaml: -------------------------------------------------------------------------------- 1 | resourceSpans: 2 | - resource: 3 | attributes: 4 | - key: resource.required 5 | value: 6 | stringValue: foo 7 | - key: resource.optional 8 | value: 9 | stringValue: bar 10 | scopeSpans: 11 | - scope: {} 12 | spans: 13 | - attributes: 14 | - key: db.name 15 | value: 16 | stringValue: main 17 | - key: db.system 18 | value: 19 | stringValue: mysql 20 | endTimeUnixNano: "1581452773000000789" 21 | events: 22 | - attributes: 23 | - key: event.attr1 24 | value: 25 | stringValue: foo1 26 | - key: event.attr2 27 | value: 28 | stringValue: bar1 29 | name: event1 30 | timeUnixNano: "1581452773000000123" 31 | - attributes: 32 | - key: event.attr1 33 | value: 34 | stringValue: foo2 35 | - key: event.attr2 36 | value: 37 | stringValue: bar2 38 | name: event2 39 | timeUnixNano: "1581452773000000123" 40 | - name: event-with-no-attrs 41 | timeUnixNano: "1581452773000000123" 42 | name: span-elastic-db 43 | parentSpanId: "bcff497b5a47310f" 44 | startTimeUnixNano: "1581452772000000321" 45 | 46 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/elastic_txn_messaging/input.yaml: -------------------------------------------------------------------------------- 1 | resourceSpans: 2 | - resource: 3 | attributes: 4 | - key: resource.test1 5 | value: 6 | stringValue: foo 7 | - key: resource.test2 8 | value: 9 | stringValue: bar 10 | scopeSpans: 11 | - scope: {} 12 | spans: 13 | - attributes: 14 | - key: messaging.system 15 | value: 16 | stringValue: kafka 17 | - key: messaging.destination.name 18 | value: 19 | stringValue: TestTopic 20 | endTimeUnixNano: "1581452773000000789" 21 | events: 22 | - attributes: 23 | - key: event.attr1 24 | value: 25 | stringValue: foo1 26 | - key: event.attr2 27 | value: 28 | stringValue: bar1 29 | name: event1 30 | timeUnixNano: "1581452773000000123" 31 | - attributes: 32 | - key: event.attr1 33 | value: 34 | stringValue: foo2 35 | - key: event.attr2 36 | value: 37 | stringValue: bar2 38 | name: event2 39 | timeUnixNano: "1581452773000000123" 40 | - name: event-with-no-attrs 41 | timeUnixNano: "1581452773000000123" 42 | name: msg-elastic-txn 43 | parentSpanId: "" 44 | startTimeUnixNano: "1581452772000000321" 45 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/sum_delta/input.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - schemaUrl: https://test-res-schema.com/schema 3 | resource: 4 | attributes: 5 | - key: asdf 6 | value: 7 | stringValue: foo 8 | scopeMetrics: 9 | - schemaUrl: https://test-scope-schema.com/schema 10 | scope: 11 | name: MyTestInstrument 12 | version: "1.2.3" 13 | attributes: 14 | - key: foo 15 | value: 16 | stringValue: bar 17 | metrics: 18 | - name: delta.monotonic.sum 19 | sum: 20 | aggregationTemporality: 1 21 | isMonotonic: true 22 | dataPoints: 23 | - timeUnixNano: 5000000 24 | asDouble: 333 25 | attributes: 26 | - key: aaa 27 | value: 28 | stringValue: bbb 29 | # This data point is out of order 30 | # The aggregator should ignore it since the first data point has a newer timestamp 31 | - timeUnixNano: 2000000 32 | asDouble: 222 33 | attributes: 34 | - key: aaa 35 | value: 36 | stringValue: bbb 37 | # This one is the newest, so it should be the one stored 38 | - timeUnixNano: 8000000 39 | asDouble: 444 40 | attributes: 41 | - key: aaa 42 | value: 43 | stringValue: bbb 44 | 45 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/sum_cumulative/input.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - schemaUrl: https://test-res-schema.com/schema 3 | resource: 4 | attributes: 5 | - key: asdf 6 | value: 7 | stringValue: foo 8 | scopeMetrics: 9 | - schemaUrl: https://test-scope-schema.com/schema 10 | scope: 11 | name: MyTestInstrument 12 | version: "1.2.3" 13 | attributes: 14 | - key: foo 15 | value: 16 | stringValue: bar 17 | metrics: 18 | - name: cumulative.monotonic.sum 19 | sum: 20 | aggregationTemporality: 2 21 | isMonotonic: true 22 | dataPoints: 23 | - timeUnixNano: 5000000 24 | asDouble: 333 25 | attributes: 26 | - key: aaa 27 | value: 28 | stringValue: bbb 29 | # This data point is out of order 30 | # The aggregator should ignore it since the first data point has a newer timestamp 31 | - timeUnixNano: 2000000 32 | asDouble: 222 33 | attributes: 34 | - key: aaa 35 | value: 36 | stringValue: bbb 37 | # This one is the newest, so it should be the one stored 38 | - timeUnixNano: 8000000 39 | asDouble: 444 40 | attributes: 41 | - key: aaa 42 | value: 43 | stringValue: bbb 44 | -------------------------------------------------------------------------------- /extension/apikeyauthextension/factory.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package apikeyauthextension // import "github.com/elastic/opentelemetry-collector-components/extension/apikeyauthextension" 19 | 20 | import ( 21 | "context" 22 | 23 | "go.opentelemetry.io/collector/component" 24 | "go.opentelemetry.io/collector/extension" 25 | 26 | "github.com/elastic/opentelemetry-collector-components/extension/apikeyauthextension/internal/metadata" 27 | ) 28 | 29 | func NewFactory() extension.Factory { 30 | return extension.NewFactory( 31 | metadata.Type, 32 | createDefaultConfig, 33 | createExtension, 34 | metadata.ExtensionStability, 35 | ) 36 | } 37 | 38 | func createExtension(_ context.Context, set extension.Settings, cfg component.Config) (extension.Extension, error) { 39 | return newAuthenticator(cfg.(*Config), set) 40 | } 41 | -------------------------------------------------------------------------------- /internal/sharedcomponent/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/elastic/opentelemetry-collector-components/internal/sharedcomponent 2 | 3 | go 1.24.0 4 | 5 | require ( 6 | github.com/stretchr/testify v1.11.1 7 | go.opentelemetry.io/collector/component v1.46.0 8 | go.opentelemetry.io/collector/component/componentstatus v0.140.0 9 | go.opentelemetry.io/collector/component/componenttest v0.140.0 10 | go.uber.org/goleak v1.3.0 11 | ) 12 | 13 | require ( 14 | github.com/davecgh/go-spew v1.1.1 // indirect 15 | github.com/go-logr/logr v1.4.3 // indirect 16 | github.com/go-logr/stdr v1.2.2 // indirect 17 | github.com/google/uuid v1.6.0 // indirect 18 | github.com/hashicorp/go-version v1.7.0 // indirect 19 | github.com/json-iterator/go v1.1.12 // indirect 20 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect 21 | github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect 22 | github.com/pmezard/go-difflib v1.0.0 // indirect 23 | go.opentelemetry.io/auto/sdk v1.1.0 // indirect 24 | go.opentelemetry.io/collector/featuregate v1.46.0 // indirect 25 | go.opentelemetry.io/collector/pdata v1.46.0 // indirect 26 | go.opentelemetry.io/collector/pipeline v1.46.0 // indirect 27 | go.opentelemetry.io/otel v1.38.0 // indirect 28 | go.opentelemetry.io/otel/metric v1.38.0 // indirect 29 | go.opentelemetry.io/otel/sdk v1.38.0 // indirect 30 | go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect 31 | go.opentelemetry.io/otel/trace v1.38.0 // indirect 32 | go.uber.org/multierr v1.11.0 // indirect 33 | go.uber.org/zap v1.27.0 // indirect 34 | golang.org/x/sys v0.35.0 // indirect 35 | gopkg.in/yaml.v3 v3.0.1 // indirect 36 | ) 37 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/elastic_span_messaging/input.yaml: -------------------------------------------------------------------------------- 1 | resourceSpans: 2 | - resource: 3 | attributes: 4 | - key: resource.required 5 | value: 6 | stringValue: foo 7 | - key: resource.optional 8 | value: 9 | stringValue: bar 10 | scopeSpans: 11 | - scope: {} 12 | spans: 13 | - attributes: 14 | - key: messaging.system 15 | value: 16 | stringValue: kafka 17 | - key: messaging.destination.name 18 | value: 19 | stringValue: TestTopic 20 | endTimeUnixNano: "1581452773000000789" 21 | events: 22 | - attributes: 23 | - key: event.attr1 24 | value: 25 | stringValue: foo1 26 | - key: event.attr2 27 | value: 28 | stringValue: bar1 29 | name: event1 30 | timeUnixNano: "1581452773000000123" 31 | - attributes: 32 | - key: event.attr1 33 | value: 34 | stringValue: foo2 35 | - key: event.attr2 36 | value: 37 | stringValue: bar2 38 | name: event2 39 | timeUnixNano: "1581452773000000123" 40 | - name: event-with-no-attrs 41 | timeUnixNano: "1581452773000000123" 42 | name: span-elastic-msg 43 | parentSpanId: "bcff497b5a47310f" 44 | startTimeUnixNano: "1581452772000000321" 45 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/internal/mappers/idConverter.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package mappers // import "github.com/elastic/opentelemetry-collector-components/receiver/elasticapmintakereceiver/internal/mappers" 19 | 20 | import ( 21 | "encoding/hex" 22 | 23 | "go.opentelemetry.io/collector/pdata/pcommon" 24 | ) 25 | 26 | func TraceIDFromHex(hexStr string) (pcommon.TraceID, error) { 27 | bytes, err := hex.DecodeString(hexStr) 28 | if err != nil { 29 | return pcommon.TraceID{}, err 30 | } 31 | var id pcommon.TraceID 32 | copy(id[:], bytes) 33 | return id, nil 34 | } 35 | 36 | func SpanIdFromHex(hexStr string) (pcommon.SpanID, error) { 37 | bytes, err := hex.DecodeString(hexStr) 38 | if err != nil { 39 | return pcommon.SpanID{}, err 40 | } 41 | var id pcommon.SpanID 42 | copy(id[:], bytes) 43 | return id, nil 44 | } 45 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/internal/data/expo/ord.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Copyright The OpenTelemetry Authors 19 | // SPDX-License-Identifier: Apache-2.0 20 | 21 | // This is a copy of the internal module from opentelemetry-collector-contrib: 22 | // https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/deltatocumulativeprocessor/internal/data 23 | 24 | package expo // import "github.com/elastic/opentelemetry-collector-components/processor/lsmintervalprocessor/internal/data/expo" 25 | 26 | import "cmp" 27 | 28 | // HiLo returns the greater of a and b by comparing the result of applying fn to 29 | // each. If equal, returns operands as passed 30 | func HiLo[T any, N cmp.Ordered](a, b T, fn func(T) N) (hi, lo T) { 31 | an, bn := fn(a), fn(b) 32 | if cmp.Less(an, bn) { 33 | return b, a 34 | } 35 | return a, b 36 | } 37 | -------------------------------------------------------------------------------- /extension/apikeyauthextension/factory_test.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package apikeyauthextension 19 | 20 | import ( 21 | "context" 22 | "testing" 23 | 24 | "github.com/stretchr/testify/assert" 25 | "github.com/stretchr/testify/require" 26 | "go.opentelemetry.io/collector/extension/extensiontest" 27 | 28 | "github.com/elastic/opentelemetry-collector-components/extension/apikeyauthextension/internal/metadata" 29 | ) 30 | 31 | func TestNewFactory(t *testing.T) { 32 | f := NewFactory() 33 | assert.NotNil(t, f) 34 | } 35 | 36 | func TestFactory_Create(t *testing.T) { 37 | f := NewFactory() 38 | assert.NotNil(t, f) 39 | 40 | cfg := f.CreateDefaultConfig().(*Config) 41 | 42 | settings := extensiontest.NewNopSettings(metadata.Type) 43 | ext, err := f.Create(context.Background(), settings, cfg) 44 | require.NoError(t, err) 45 | assert.NotNil(t, ext) 46 | } 47 | -------------------------------------------------------------------------------- /extension/apmconfigextension/logger.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package apmconfigextension // import "github.com/elastic/opentelemetry-collector-components/extension/apmconfigextension" 19 | 20 | import ( 21 | "context" 22 | 23 | "github.com/open-telemetry/opamp-go/client/types" 24 | "go.uber.org/zap" 25 | ) 26 | 27 | var _ types.Logger = &opAMPLogger{} 28 | 29 | type opAMPLogger struct { 30 | l *zap.SugaredLogger 31 | } 32 | 33 | // Debugf implements types.Logger. 34 | func (o *opAMPLogger) Debugf(_ context.Context, format string, v ...any) { 35 | o.l.Debugf(format, v...) 36 | } 37 | 38 | // Errorf implements types.Logger. 39 | func (o *opAMPLogger) Errorf(_ context.Context, format string, v ...any) { 40 | o.l.Errorf(format, v...) 41 | } 42 | 43 | func newLoggerFromZap(l *zap.Logger) types.Logger { 44 | return &opAMPLogger{ 45 | l: l.Sugar(), 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /extension/clientaddrmiddlewareextension/factory.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package clientaddrmiddlewareextension // import "github.com/elastic/opentelemetry-collector-components/extension/clientaddrmiddlewareextension" 19 | 20 | import ( 21 | "context" 22 | 23 | "go.opentelemetry.io/collector/component" 24 | "go.opentelemetry.io/collector/extension" 25 | 26 | "github.com/elastic/opentelemetry-collector-components/extension/clientaddrmiddlewareextension/internal/metadata" 27 | ) 28 | 29 | func NewFactory() extension.Factory { 30 | return extension.NewFactory( 31 | metadata.Type, 32 | createDefaultConfig, 33 | createExtension, 34 | metadata.ExtensionStability, 35 | ) 36 | } 37 | 38 | func createExtension(_ context.Context, set extension.Settings, cfg component.Config) (extension.Extension, error) { 39 | return newClientAddrMiddleware(cfg.(*Config), set) 40 | } 41 | -------------------------------------------------------------------------------- /.github/workflows/release_otelbench.yaml: -------------------------------------------------------------------------------- 1 | name: release-otelbench 2 | run-name: Release otelbench docker image on elastic container library 3 | 4 | on: 5 | push: 6 | branches: 7 | - main 8 | paths: 9 | - loadgen/cmd/otelbench/CHANGELOG.md 10 | 11 | 12 | permissions: 13 | contents: read 14 | 15 | jobs: 16 | release-otelbench: 17 | timeout-minutes: 15 18 | runs-on: ubuntu-latest 19 | permissions: 20 | contents: write 21 | env: 22 | ELASTIC_REGISTRY: "docker.elastic.co/observability-ci/otelbench" 23 | strategy: 24 | matrix: 25 | platform: ["linux/amd64", "linux/arm64"] 26 | steps: 27 | - uses: actions/checkout@v6 28 | 29 | - name: Login to Elastic container registry 30 | uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 31 | with: 32 | registry: ${{ env.ELASTIC_REGISTRY }} 33 | username: ${{ secrets.ELASTIC_DOCKER_USERNAME }} 34 | password: ${{ secrets.ELASTIC_DOCKER_PASSWORD }} 35 | 36 | - name: Get otelbench version 37 | working-directory: ./loadgen/cmd/otelbench 38 | run: echo "OTELBENCH_VERSION=$(make get-version 2>/dev/null || echo 'v0.0.0')" >> $GITHUB_ENV 39 | 40 | - uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9 41 | env: 42 | KO_DOCKER_REPO: ${{ env.ELASTIC_REGISTRY }} 43 | 44 | - name: Build container image and push to Elastic registry 45 | working-directory: ./loadgen/cmd/otelbench 46 | run: | 47 | export KO_DOCKER_REPO=${{ env.ELASTIC_REGISTRY }} 48 | ko build --bare --platform=${{ matrix.platform }} --tags ${{ env.OTELBENCH_VERSION }} -------------------------------------------------------------------------------- /receiver/loadgenreceiver/internal/list/looping_test.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package list 19 | 20 | import ( 21 | "fmt" 22 | "testing" 23 | 24 | "github.com/stretchr/testify/assert" 25 | ) 26 | 27 | func TestNext_loopLimit(t *testing.T) { 28 | for _, loopLimit := range []int{0, 10} { 29 | t.Run(fmt.Sprintf("loopLimit=%d", loopLimit), func(t *testing.T) { 30 | items := []int{0, 1, 2} 31 | l := NewLoopingList(items, loopLimit) 32 | for i := 0; ; i++ { 33 | item, err := l.Next() 34 | if loopLimit == 0 { 35 | if i > 10 { 36 | // terminate after some point if infinitely looping 37 | return 38 | } 39 | } else { 40 | if i >= len(items)*loopLimit { 41 | assert.ErrorIs(t, err, ErrLoopLimitReached) 42 | return 43 | } 44 | } 45 | assert.NoError(t, err) 46 | assert.Equal(t, i%3, item) 47 | } 48 | }) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /receiver/elasticapmintakereceiver/testdata/invalid_ids.ndjson: -------------------------------------------------------------------------------- 1 | {"metadata": {"service": {"name": "1234_service-12a3","node": {"configured_name": "node-123"},"version": "5.1.3","environment": "staging","language": {"name": "ecmascript","version": "8"},"runtime": {"name": "node","version": "8.0.0"},"framework": {"name": "Express","version": "1.2.3"},"agent": {"name": "elastic-node", "activation_method": "some_activation_method","version": "3.14.0"}},"user": {"id": "123user", "username": "bar", "email": "bar@user.com"}, "labels": {"tag0": null, "tag1": "one", "tag2": 2}, "process": {"pid": 1234,"ppid": 6789,"title": "node","argv": ["node","server.js"]},"system": {"architecture": "x64","platform": "darwin", "container": {"id": "container-id"}, "kubernetes": {"namespace": "namespace1", "pod": {"uid": "pod-uid", "name": "pod-name"}, "node": {"name": "node-name"}}},"cloud":{"account":{"id":"account_id","name":"account_name"},"availability_zone":"cloud_availability_zone","instance":{"id":"instance_id","name":"instance_name"},"machine":{"type":"machine_type"},"project":{"id":"project_id","name":"project_name"},"provider":"cloud_provider","region":"cloud_region","service":{"name":"lambda"}}}} 2 | {"transaction": { "id": "foobarInvalid", "trace_id": "0123456789abcdef0123456789abcdefTooLoooong", "parent_id": "foobarInvalid2", "type": "request", "duration": 32.592981, "timestamp": 1496170407154000, "span_count": { "started": 43 } } } 3 | {"span": {"trace_id": "0123456789abcdef0123456789abcdefTooLoooong", "parent_id": "invalid", "id": "invalid", "child_ids": ["51234abcdef56789"], "transaction_id": "01af25874dec69dd", "name": "GET /api/types", "type": "db.postgresql.query.custom","start": null, "duration": 141.581, "timestamp": 1532976822281000, "outcome": "success"}} -------------------------------------------------------------------------------- /connector/profilingmetricsconnector/config.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package profilingmetricsconnector // import "github.com/elastic/opentelemetry-collector-components/connector/profilingmetricsconnector" 19 | 20 | import "github.com/elastic/opentelemetry-collector-components/connector/profilingmetricsconnector/internal/metadata" 21 | 22 | // Aggregation applies Match as a regular expression on function strings 23 | // and generates a metric with Label if it matches. 24 | type Aggregation struct { 25 | Match string `mapstructure:"match"` 26 | Label string `mapstructure:"label"` 27 | } 28 | 29 | // Config represents the receiver config settings within the collector's config.yaml 30 | type Config struct { 31 | metadata.MetricsBuilderConfig `mapstructure:",squash"` 32 | 33 | // CustomAggregations allows to generate custom metrics. 34 | CustomAggregations []Aggregation `mapstructure:"aggregations"` 35 | } 36 | -------------------------------------------------------------------------------- /receiver/loadgenreceiver/stats.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package loadgenreceiver // import "github.com/elastic/opentelemetry-collector-components/receiver/loadgenreceiver" 19 | 20 | // Stats holds statistics about telemetry generated and sent by loadgenreceiver 21 | type Stats struct { 22 | Requests int 23 | FailedRequests int 24 | 25 | LogRecords int 26 | MetricDataPoints int 27 | Spans int 28 | 29 | FailedLogRecords int 30 | FailedMetricDataPoints int 31 | FailedSpans int 32 | } 33 | 34 | func (s Stats) Add(other Stats) Stats { 35 | s.Requests += other.Requests 36 | s.FailedRequests += other.FailedRequests 37 | s.LogRecords += other.LogRecords 38 | s.MetricDataPoints += other.MetricDataPoints 39 | s.Spans += other.Spans 40 | s.FailedLogRecords += other.FailedLogRecords 41 | s.FailedMetricDataPoints += other.FailedMetricDataPoints 42 | s.FailedSpans += other.FailedSpans 43 | return s 44 | } 45 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/elastic_txn_http/input.yaml: -------------------------------------------------------------------------------- 1 | resourceSpans: 2 | - resource: 3 | attributes: 4 | - key: resource.required 5 | value: 6 | stringValue: foo 7 | - key: resource.optional 8 | value: 9 | stringValue: bar 10 | scopeSpans: 11 | - scope: {} 12 | spans: 13 | - attributes: 14 | - key: http.request.method 15 | value: 16 | stringValue: POST 17 | - key: url.full 18 | value: 19 | stringValue: https://www.foo.bar/search?q=OpenTelemetry#SemConv 20 | - key: http.response.status_code 21 | value: 22 | intValue: 201 23 | endTimeUnixNano: "1581452773000000789" 24 | events: 25 | - attributes: 26 | - key: event.attr1 27 | value: 28 | stringValue: foo1 29 | - key: event.attr2 30 | value: 31 | stringValue: bar1 32 | name: event1 33 | timeUnixNano: "1581452773000000123" 34 | - attributes: 35 | - key: event.attr1 36 | value: 37 | stringValue: foo2 38 | - key: event.attr2 39 | value: 40 | stringValue: bar2 41 | name: event2 42 | timeUnixNano: "1581452773000000123" 43 | - name: event-with-no-attrs 44 | timeUnixNano: "1581452773000000123" 45 | name: http-elastic-txn 46 | parentSpanId: "" 47 | startTimeUnixNano: "1581452772000000321" 48 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/histogram_delta/output.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: asdf 5 | value: 6 | stringValue: foo 7 | - key: custom_res_attr 8 | value: 9 | stringValue: res 10 | - key: dependent_attr 11 | value: 12 | stringValue: bbb-dependent 13 | schemaUrl: https://test-res-schema.com/schema 14 | scopeMetrics: 15 | - metrics: 16 | - histogram: 17 | aggregationTemporality: 1 18 | dataPoints: 19 | - attributes: 20 | - key: aaa 21 | value: 22 | stringValue: bbb 23 | - key: custom_dp_attr 24 | value: 25 | stringValue: dp 26 | bucketCounts: 27 | - "25" 28 | - "15" 29 | - "22" 30 | - "33" 31 | - "18" 32 | - "79" 33 | explicitBounds: 34 | - 0.01 35 | - 0.1 36 | - 1 37 | - 10 38 | - 100 39 | timeUnixNano: "8000000" 40 | count: 192 41 | sum: 8380 42 | name: delta.histogram.test 43 | schemaUrl: https://test-scope-schema.com/schema 44 | scope: 45 | attributes: 46 | - key: custom_scope_attr 47 | value: 48 | stringValue: scope 49 | - key: foo 50 | value: 51 | stringValue: bar 52 | name: MyTestInstrument 53 | version: 1.2.3 54 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/internal/identity/strings.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Copyright The OpenTelemetry Authors 19 | // SPDX-License-Identifier: Apache-2.0 20 | 21 | // This is a copy of the internal module from opentelemetry-collector-contrib: 22 | // https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/internal/exp/metrics/identity 23 | 24 | package identity // import "github.com/elastic/opentelemetry-collector-components/processor/lsmintervalprocessor/internal/identity" 25 | 26 | import ( 27 | "fmt" 28 | ) 29 | 30 | func (r Resource) String() string { 31 | return fmt.Sprintf("resource/%x", r.Hash().Sum64()) 32 | } 33 | 34 | func (s Scope) String() string { 35 | return fmt.Sprintf("scope/%x", s.Hash().Sum64()) 36 | } 37 | 38 | func (m Metric) String() string { 39 | return fmt.Sprintf("metric/%x", m.Hash().Sum64()) 40 | } 41 | 42 | func (s Stream) String() string { 43 | return fmt.Sprintf("stream/%x", s.Hash().Sum64()) 44 | } 45 | -------------------------------------------------------------------------------- /processor/elasticapmprocessor/testdata/elastic_span_http/input.yaml: -------------------------------------------------------------------------------- 1 | resourceSpans: 2 | - resource: 3 | attributes: 4 | - key: resource.required 5 | value: 6 | stringValue: foo 7 | - key: resource.optional 8 | value: 9 | stringValue: bar 10 | scopeSpans: 11 | - scope: {} 12 | spans: 13 | - attributes: 14 | - key: http.request.method 15 | value: 16 | stringValue: POST 17 | - key: url.full 18 | value: 19 | stringValue: https://www.foo.bar/search?q=OpenTelemetry#SemConv 20 | - key: http.response.status_code 21 | value: 22 | intValue: 201 23 | endTimeUnixNano: "1581452773000000789" 24 | events: 25 | - attributes: 26 | - key: event.attr1 27 | value: 28 | stringValue: foo1 29 | - key: event.attr2 30 | value: 31 | stringValue: bar1 32 | name: event1 33 | timeUnixNano: "1581452773000000123" 34 | - attributes: 35 | - key: event.attr1 36 | value: 37 | stringValue: foo2 38 | - key: event.attr2 39 | value: 40 | stringValue: bar2 41 | name: event2 42 | timeUnixNano: "1581452773000000123" 43 | - name: event-with-no-attrs 44 | timeUnixNano: "1581452773000000123" 45 | name: span-elastic-http 46 | parentSpanId: "bcff497b5a47310f" 47 | startTimeUnixNano: "1581452772000000321" 48 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/histogram_cumulative/output.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - resource: 3 | attributes: 4 | - key: asdf 5 | value: 6 | stringValue: foo 7 | - key: custom_res_attr 8 | value: 9 | stringValue: res 10 | - key: dependent_attr 11 | value: 12 | stringValue: bbb-dependent 13 | schemaUrl: https://test-res-schema.com/schema 14 | scopeMetrics: 15 | - metrics: 16 | - histogram: 17 | aggregationTemporality: 2 18 | dataPoints: 19 | - attributes: 20 | - key: aaa 21 | value: 22 | stringValue: bbb 23 | - key: custom_dp_attr 24 | value: 25 | stringValue: dp 26 | bucketCounts: 27 | - "11" 28 | - "9" 29 | - "12" 30 | - "17" 31 | - "8" 32 | - "34" 33 | explicitBounds: 34 | - 0.01 35 | - 0.1 36 | - 1 37 | - 10 38 | - 100 39 | timeUnixNano: "8000000" 40 | sum: 3600 41 | count: 91 42 | name: cumulative.histogram.test 43 | schemaUrl: https://test-scope-schema.com/schema 44 | scope: 45 | attributes: 46 | - key: custom_scope_attr 47 | value: 48 | stringValue: scope 49 | - key: foo 50 | value: 51 | stringValue: bar 52 | name: MyTestInstrument 53 | version: 1.2.3 54 | -------------------------------------------------------------------------------- /internal/tools/tools.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | //go:build tools 19 | 20 | package tools // import "github.com/elastic/opentelemetry-collector-components/internal/tools" 21 | 22 | // This file follows the recommendation at 23 | // https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module 24 | // on how to pin tooling dependencies to a go.mod file. 25 | // This ensures that all systems use the same version of tools in addition to regular dependencies. 26 | 27 | import ( 28 | _ "github.com/client9/misspell/cmd/misspell" 29 | _ "github.com/elastic/go-licenser" 30 | _ "github.com/golangci/golangci-lint/cmd/golangci-lint" 31 | _ "github.com/jcchavezs/porto/cmd/porto" 32 | _ "go.opentelemetry.io/build-tools/chloggen" 33 | _ "go.opentelemetry.io/build-tools/multimod" 34 | _ "go.opentelemetry.io/collector/cmd/builder" 35 | _ "go.opentelemetry.io/collector/cmd/mdatagen" 36 | _ "golang.org/x/tools/cmd/goimports" 37 | _ "golang.org/x/vuln/cmd/govulncheck" 38 | ) 39 | -------------------------------------------------------------------------------- /extension/configintegrationextension/factory.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package configintegrationextension // import "github.com/elastic/opentelemetry-collector-components/extension/configintegrationextension" 19 | 20 | import ( 21 | "context" 22 | 23 | "go.opentelemetry.io/collector/component" 24 | "go.opentelemetry.io/collector/extension" 25 | 26 | "github.com/elastic/opentelemetry-collector-components/extension/configintegrationextension/internal/metadata" 27 | ) 28 | 29 | // NewFactory creates a factory for ack extension. 30 | func NewFactory() extension.Factory { 31 | return extension.NewFactory( 32 | metadata.Type, 33 | createDefaultConfig, 34 | createExtension, 35 | metadata.ExtensionStability, 36 | ) 37 | } 38 | 39 | func createDefaultConfig() component.Config { 40 | return &Config{} 41 | } 42 | 43 | func createExtension(_ context.Context, _ extension.Settings, cfg component.Config) (extension.Extension, error) { 44 | return newConfigTemplateExtension(cfg.(*Config)), nil 45 | } 46 | -------------------------------------------------------------------------------- /processor/lsmintervalprocessor/testdata/histogram_delta/input.yaml: -------------------------------------------------------------------------------- 1 | resourceMetrics: 2 | - schemaUrl: https://test-res-schema.com/schema 3 | resource: 4 | attributes: 5 | - key: asdf 6 | value: 7 | stringValue: foo 8 | scopeMetrics: 9 | - schemaUrl: https://test-scope-schema.com/schema 10 | scope: 11 | name: MyTestInstrument 12 | version: "1.2.3" 13 | attributes: 14 | - key: foo 15 | value: 16 | stringValue: bar 17 | metrics: 18 | - name: delta.histogram.test 19 | histogram: 20 | aggregationTemporality: 1 21 | dataPoints: 22 | - timeUnixNano: 5000000 23 | count: 60 24 | sum: 2670 25 | explicitBounds: [0.01, 0.1, 1, 10, 100] 26 | bucketCounts: [9, 4, 7, 9, 6, 25] 27 | attributes: 28 | - key: aaa 29 | value: 30 | stringValue: bbb 31 | - timeUnixNano: 2000000 32 | count: 41 33 | sum: 2110 34 | explicitBounds: [0.01, 0.1, 1, 10, 100] 35 | bucketCounts: [5, 2, 3, 7, 4, 20] 36 | attributes: 37 | - key: aaa 38 | value: 39 | stringValue: bbb 40 | - timeUnixNano: 8000000 41 | count: 91 42 | sum: 3600 43 | explicitBounds: [0.01, 0.1, 1, 10, 100] 44 | bucketCounts: [11, 9, 12, 17, 8, 34] 45 | attributes: 46 | - key: aaa 47 | value: 48 | stringValue: bbb 49 | -------------------------------------------------------------------------------- /receiver/integrationreceiver/config.go: -------------------------------------------------------------------------------- 1 | // Licensed to Elasticsearch B.V. under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Elasticsearch B.V. licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package integrationreceiver // import "github.com/elastic/opentelemetry-collector-components/receiver/integrationreceiver" 19 | 20 | import ( 21 | "errors" 22 | 23 | "go.opentelemetry.io/collector/pipeline" 24 | ) 25 | 26 | // Config is the structured configuration of the receiver. 27 | type Config struct { 28 | // Name of the integration to instantiate, resolved by the finder extensions. 29 | Name string `mapstructure:"name"` 30 | 31 | // Pipelines is the list of pipelines to instantiate, from the referenced integration. 32 | Pipelines []pipeline.ID `mapstructure:"pipelines"` 33 | 34 | // Parameters are used to resolve the placeholders in parameterized integrations. 35 | Parameters map[string]any `mapstructure:"parameters"` 36 | } 37 | 38 | // Validate validates the configuration. 39 | func (cfg *Config) Validate() error { 40 | if cfg.Name == "" { 41 | return errors.New("name is required") 42 | } 43 | 44 | return nil 45 | } 46 | --------------------------------------------------------------------------------