├── .chloggen ├── TEMPLATE.yaml ├── codeboten_configauth-deprecated.yaml ├── codeboten_rm-deprecated-103.yaml ├── codeboten_update-all-metrics-with-prefix.yaml ├── codeboten_update-units-processorhelper.yaml ├── component-profiles.yaml ├── componenttest-extra-attributes.yaml ├── config.yaml ├── confmap-increase-recursive-count.yaml ├── delete_custom_roundtripper.yaml ├── document_factories.yaml ├── document_fields.yaml ├── experimental_include_metadata.yaml ├── exporterhelper-report-data-type-in-queue-metrics.yaml ├── exporterhelper_metric_units.yaml ├── fix-env-var-double-escaping.yaml ├── jpkroehling-add-query-params-to-authcontext-api.yaml ├── jpkroehling-add-query-params-to-authcontext.yaml ├── jpkroehling-grpc-statuscode.yaml ├── mdatagen-remove-with-attributes-helper.yaml ├── mx-psi_string-value-for-string-fields.yaml ├── mx-psi_validate-uris.yaml ├── nameval_refactor.yaml ├── newdefaultserverconfig.yaml ├── profiles-consumertest.yaml ├── receiverhelper_metric_units.yaml ├── scraperhelper_metric_units.yaml ├── service-remove-ballast-deps-2.yaml ├── service-remove-ballast-deps-3.yaml ├── service-remove-ballast-deps.yaml └── telemetry-service-name.yaml ├── .codecov.yml ├── .gitattributes ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ ├── release.md │ └── stabilization.md ├── pull_request_template.md └── workflows │ ├── api-compatibility.yml │ ├── build-and-test-arm.yml │ ├── build-and-test-windows.yaml │ ├── build-and-test.yml │ ├── builder-integration-test.yaml │ ├── builder-release.yaml │ ├── changelog.yml │ ├── check-goreleaser.yaml │ ├── check-links.yaml │ ├── check_links_config.json │ ├── codeql-analysis.yml │ ├── contrib-tests.yml │ ├── generate-semantic-conventions-pr.yaml │ ├── milestone-add-to-pr.yml │ ├── perf.yml │ ├── prepare-release.yml │ ├── scorecard.yml │ ├── scripts │ ├── release-check-blockers.sh │ ├── release-check-build-status.sh │ ├── release-create-tracking-issue.sh │ └── release-prepare-release.sh │ ├── shellcheck.yml │ ├── stale-pr.yaml │ └── tidy-dependencies.yml ├── .gitignore ├── .gitmodules ├── .golangci.yml ├── CHANGELOG-API.md ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── Makefile.Common ├── README.md ├── VERSIONING.md ├── client ├── client.go ├── client_test.go ├── doc_test.go └── package_test.go ├── cmd ├── builder │ ├── .goreleaser.yml │ ├── Makefile │ ├── README.md │ ├── RELEASE.md │ ├── go.mod │ ├── go.sum │ ├── header.txt │ ├── internal │ │ ├── builder │ │ │ ├── config.go │ │ │ ├── config_test.go │ │ │ ├── main.go │ │ │ ├── main_test.go │ │ │ ├── package_test.go │ │ │ ├── templates.go │ │ │ └── templates │ │ │ │ ├── components.go.tmpl │ │ │ │ ├── go.mod.tmpl │ │ │ │ ├── main.go.tmpl │ │ │ │ ├── main_others.go.tmpl │ │ │ │ └── main_windows.go.tmpl │ │ ├── command.go │ │ ├── command_test.go │ │ ├── config │ │ │ ├── default.go │ │ │ └── default.yaml │ │ ├── package_test.go │ │ └── version.go │ ├── main.go │ └── test │ │ ├── README.md │ │ ├── core.builder.yaml │ │ ├── core.otel.yaml │ │ └── test.sh ├── mdatagen │ ├── Makefile │ ├── README.md │ ├── embeded_templates.go │ ├── embeded_templates_test.go │ ├── generated_package_test.go │ ├── go.mod │ ├── go.sum │ ├── internal │ │ └── samplereceiver │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ ├── documentation.md │ │ │ ├── factory.go │ │ │ ├── generated_component_telemetry_test.go │ │ │ ├── generated_component_test.go │ │ │ ├── generated_package_test.go │ │ │ ├── internal │ │ │ └── metadata │ │ │ │ ├── generated_config.go │ │ │ │ ├── generated_config_test.go │ │ │ │ ├── generated_metrics.go │ │ │ │ ├── generated_metrics_test.go │ │ │ │ ├── generated_resource.go │ │ │ │ ├── generated_resource_test.go │ │ │ │ ├── generated_status.go │ │ │ │ ├── generated_telemetry.go │ │ │ │ ├── generated_telemetry_test.go │ │ │ │ └── testdata │ │ │ │ └── config.yaml │ │ │ ├── metadata.yaml │ │ │ └── metrics_test.go │ ├── lint.go │ ├── lint_test.go │ ├── loader.go │ ├── loader_test.go │ ├── main.go │ ├── main_test.go │ ├── metadata-schema.yaml │ ├── metadata.yaml │ ├── metricdata.go │ ├── metricdata_test.go │ ├── statusdata.go │ ├── statusdata_test.go │ ├── templates │ │ ├── component_telemetry_test.go.tmpl │ │ ├── component_test.go.tmpl │ │ ├── config.go.tmpl │ │ ├── config_test.go.tmpl │ │ ├── documentation.md.tmpl │ │ ├── metrics.go.tmpl │ │ ├── metrics_test.go.tmpl │ │ ├── package_test.go.tmpl │ │ ├── readme.md.tmpl │ │ ├── resource.go.tmpl │ │ ├── resource_test.go.tmpl │ │ ├── status.go.tmpl │ │ ├── telemetry.go.tmpl │ │ ├── telemetry_test.go.tmpl │ │ └── testdata │ │ │ └── config.yaml.tmpl │ ├── testdata │ │ ├── invalid.yaml │ │ ├── invalid_aggregation.yaml │ │ ├── invalid_class.yaml │ │ ├── invalid_input_type.yaml │ │ ├── invalid_stability.yaml │ │ ├── invalid_stability_component.yaml │ │ ├── invalid_telemetry_missing_value_type_for_histogram.yaml │ │ ├── invalid_type_attr.yaml │ │ ├── invalid_type_rattr.yaml │ │ ├── metrics_and_type.yaml │ │ ├── no_aggregation.yaml │ │ ├── no_class.yaml │ │ ├── no_description_attr.yaml │ │ ├── no_description_rattr.yaml │ │ ├── no_enabled.yaml │ │ ├── no_metric_description.yaml │ │ ├── no_metric_type.yaml │ │ ├── no_metric_unit.yaml │ │ ├── no_monotonic.yaml │ │ ├── no_stability.yaml │ │ ├── no_stability_component.yaml │ │ ├── no_status.yaml │ │ ├── no_type.yaml │ │ ├── no_type_attr.yaml │ │ ├── no_type_rattr.yaml │ │ ├── no_value_type.yaml │ │ ├── parent.yaml │ │ ├── readme_with_cmd_class.md │ │ ├── readme_with_multiple_signals.md │ │ ├── readme_with_status.md │ │ ├── readme_with_status_codeowners.md │ │ ├── readme_with_status_codeowners_and_emeritus.md │ │ ├── readme_with_status_codeowners_and_seeking_new.md │ │ ├── readme_with_status_extension.md │ │ ├── readme_with_warnings.md │ │ ├── readme_without_status.md │ │ ├── resource_attributes_only.yaml │ │ ├── status_only.yaml │ │ ├── two_metric_types.yaml │ │ ├── unknown_metric_attribute.yaml │ │ ├── unknown_value_type.yaml │ │ ├── unused_attribute.yaml │ │ ├── with_goleak_ignores.yaml │ │ ├── with_goleak_setup.yaml │ │ ├── with_goleak_skip.yaml │ │ ├── with_goleak_teardown.yaml │ │ ├── with_telemetry.yaml │ │ ├── with_tests_connector.yaml │ │ ├── with_tests_exporter.yaml │ │ ├── with_tests_extension.yaml │ │ ├── with_tests_processor.yaml │ │ └── with_tests_receiver.yaml │ ├── third_party │ │ └── golint │ │ │ ├── LICENSE │ │ │ └── golint.go │ ├── validate.go │ └── validate_test.go └── otelcorecol │ ├── Makefile │ ├── README.md │ ├── builder-config.yaml │ ├── components.go │ ├── go.mod │ ├── go.sum │ ├── main.go │ ├── main_others.go │ └── main_windows.go ├── component ├── Makefile ├── build_info.go ├── component.go ├── component_test.go ├── componentprofiles │ ├── Makefile │ ├── config.go │ ├── go.mod │ └── go.sum ├── componenttest │ ├── configtest.go │ ├── configtest_test.go │ ├── doc.go │ ├── nop_host.go │ ├── nop_host_test.go │ ├── nop_telemetry.go │ ├── nop_telemetry_test.go │ ├── obsreporttest.go │ ├── otelprometheuschecker.go │ ├── otelprometheuschecker_test.go │ ├── package_test.go │ └── testdata │ │ └── prometheus_response ├── config.go ├── config_test.go ├── doc.go ├── go.mod ├── go.sum ├── host.go ├── identifiable.go ├── identifiable_test.go ├── package_test.go ├── status.go ├── status_test.go └── telemetry.go ├── config ├── configauth │ ├── Makefile │ ├── README.md │ ├── configauth.go │ ├── configauth_test.go │ ├── go.mod │ ├── go.sum │ └── package_test.go ├── configcompression │ ├── Makefile │ ├── compressiontype.go │ ├── compressiontype_test.go │ ├── go.mod │ ├── go.sum │ └── package_test.go ├── configgrpc │ ├── Makefile │ ├── README.md │ ├── configgrpc.go │ ├── configgrpc_benchmark_test.go │ ├── configgrpc_test.go │ ├── doc.go │ ├── go.mod │ ├── go.sum │ ├── gzip.go │ ├── package_test.go │ ├── testdata │ │ ├── ca.crt │ │ ├── client.crt │ │ ├── client.key │ │ ├── server.crt │ │ └── server.key │ ├── wrappedstream.go │ └── wrappedstream_test.go ├── confighttp │ ├── Makefile │ ├── README.md │ ├── clientinfohandler.go │ ├── clientinfohandler_test.go │ ├── compression.go │ ├── compression_test.go │ ├── compressor.go │ ├── compressor_test.go │ ├── confighttp.go │ ├── confighttp_test.go │ ├── doc.go │ ├── go.mod │ ├── go.sum │ ├── package_test.go │ └── testdata │ │ ├── ca.crt │ │ ├── client.crt │ │ ├── client.key │ │ ├── server.crt │ │ └── server.key ├── confignet │ ├── Makefile │ ├── README.md │ ├── confignet.go │ ├── confignet_test.go │ ├── doc.go │ ├── go.mod │ ├── go.sum │ └── package_test.go ├── configopaque │ ├── Makefile │ ├── doc.go │ ├── doc_test.go │ ├── go.mod │ ├── go.sum │ ├── opaque.go │ ├── opaque_test.go │ └── package_test.go ├── configretry │ ├── Makefile │ ├── backoff.go │ ├── backoff_test.go │ ├── go.mod │ ├── go.sum │ └── package_test.go ├── configtelemetry │ ├── Makefile │ ├── configtelemetry.go │ ├── configtelemetry_test.go │ ├── doc.go │ ├── go.mod │ ├── go.sum │ └── package_test.go ├── configtls │ ├── Makefile │ ├── README.md │ ├── clientcasfilereloader.go │ ├── clientcasfilereloader_test.go │ ├── configtls.go │ ├── configtls_test.go │ ├── doc.go │ ├── go.mod │ ├── go.sum │ └── testdata │ │ ├── ca-1.crt │ │ ├── ca-2.crt │ │ ├── client-1.crt │ │ ├── client-1.key │ │ ├── client-2.crt │ │ ├── client-2.key │ │ ├── server-1.crt │ │ ├── server-1.key │ │ ├── server-2.crt │ │ ├── server-2.key │ │ └── testCA-bad.txt └── internal │ ├── Makefile │ ├── go.mod │ ├── go.sum │ ├── package_test.go │ ├── warning.go │ └── warning_test.go ├── confmap ├── Makefile ├── README.md ├── confmap.go ├── confmap_test.go ├── confmaptest │ ├── configtest.go │ ├── configtest_test.go │ ├── doc.go │ ├── package_test.go │ ├── provider_settings.go │ └── testdata │ │ ├── invalid.yaml │ │ └── simple.yaml ├── converter.go ├── converter │ └── expandconverter │ │ ├── Makefile │ │ ├── expand.go │ │ ├── expand_test.go │ │ ├── go.mod │ │ ├── go.sum │ │ ├── package_test.go │ │ └── testdata │ │ ├── default-config.yaml │ │ ├── errors │ │ ├── expand-list-error.yaml │ │ ├── expand-list-map-error.yaml │ │ └── expand-map-error.yaml │ │ ├── expand-escaped-env.yaml │ │ ├── expand-with-all-env.yaml │ │ ├── expand-with-no-env.yaml │ │ └── expand-with-partial-env.yaml ├── doc_test.go ├── expand.go ├── expand_test.go ├── go.mod ├── go.sum ├── internal │ ├── e2e │ │ ├── Makefile │ │ ├── expand_test.go │ │ ├── fuzz_test.go │ │ ├── go.mod │ │ ├── go.sum │ │ ├── testdata │ │ │ ├── expand-escaped-env.yaml │ │ │ ├── types_expand.yaml │ │ │ └── types_expand_inline.yaml │ │ └── types_test.go │ ├── envvar │ │ └── pattern.go │ └── mapstructure │ │ ├── encoder.go │ │ ├── encoder_test.go │ │ └── package_test.go ├── package_test.go ├── provider.go ├── provider │ ├── envprovider │ │ ├── Makefile │ │ ├── go.mod │ │ ├── go.sum │ │ ├── package_test.go │ │ ├── provider.go │ │ └── provider_test.go │ ├── fileprovider │ │ ├── Makefile │ │ ├── go.mod │ │ ├── go.sum │ │ ├── package_test.go │ │ ├── provider.go │ │ ├── provider_test.go │ │ └── testdata │ │ │ ├── default-config.yaml │ │ │ └── invalid-yaml.yaml │ ├── httpprovider │ │ ├── Makefile │ │ ├── README.md │ │ ├── go.mod │ │ ├── go.sum │ │ ├── package_test.go │ │ ├── provider.go │ │ └── provider_test.go │ ├── httpsprovider │ │ ├── Makefile │ │ ├── README.md │ │ ├── go.mod │ │ ├── go.sum │ │ ├── package_test.go │ │ ├── provider.go │ │ └── provider_test.go │ ├── internal │ │ ├── configurablehttpprovider │ │ │ ├── package_test.go │ │ │ ├── provider.go │ │ │ ├── provider_test.go │ │ │ └── testdata │ │ │ │ └── otel-config.yaml │ │ └── package_test.go │ └── yamlprovider │ │ ├── Makefile │ │ ├── go.mod │ │ ├── go.sum │ │ ├── package_test.go │ │ ├── provider.go │ │ └── provider_test.go ├── provider_test.go ├── resolver.go ├── resolver_test.go └── testdata │ ├── basic_types.yaml │ ├── config.yaml │ ├── embedded_keys.yaml │ ├── expand-with-all-env.yaml │ ├── expand-with-no-env.yaml │ └── expand-with-partial-env.yaml ├── connector ├── Makefile ├── README.md ├── builder.go ├── connector.go ├── connector_test.go ├── connectortest │ ├── connector.go │ ├── connector_test.go │ └── package_test.go ├── forwardconnector │ ├── Makefile │ ├── README.md │ ├── doc.go │ ├── forward.go │ ├── forward_test.go │ ├── generated_component_test.go │ ├── generated_package_test.go │ ├── go.mod │ ├── go.sum │ ├── internal │ │ └── metadata │ │ │ └── generated_status.go │ └── metadata.yaml ├── go.mod ├── go.sum ├── internal │ ├── connector.go │ ├── factory.go │ ├── logs.go │ ├── metrics.go │ └── traces.go ├── logs_router.go ├── logs_router_test.go ├── metrics_router.go ├── metrics_router_test.go ├── package_test.go ├── router.go ├── traces_router.go └── traces_router_test.go ├── consumer ├── Makefile ├── consumer.go ├── consumererror │ ├── doc.go │ ├── package_test.go │ ├── permanent.go │ ├── permanent_test.go │ ├── signalerrors.go │ └── signalerrors_test.go ├── consumerprofiles │ ├── Makefile │ ├── go.mod │ ├── go.sum │ ├── profiles.go │ └── profiles_test.go ├── consumertest │ ├── Makefile │ ├── consumer.go │ ├── doc.go │ ├── err.go │ ├── err_test.go │ ├── go.mod │ ├── go.sum │ ├── nop.go │ ├── nop_test.go │ ├── package_test.go │ ├── sink.go │ └── sink_test.go ├── doc.go ├── go.mod ├── go.sum ├── internal │ └── consumer.go ├── logs.go ├── logs_test.go ├── metrics.go ├── metrics_test.go ├── package_test.go ├── traces.go └── traces_test.go ├── docs ├── component-status.md ├── ga-roadmap.md ├── img │ ├── component-status-event-generation.png │ ├── component-status-runtime-states.png │ └── component-status-state-diagram.png ├── internal-architecture.md ├── monitoring.md ├── observability.md ├── platform-support.md ├── release.md ├── rfcs │ ├── README.md │ ├── env-vars.md │ ├── experimental-profiling.md │ ├── logging-before-config-resolution.md │ └── processing.md ├── scraping-receivers.md ├── security-best-practices.md ├── standard-warnings.md ├── troubleshooting.md └── vision.md ├── examples ├── README.md ├── k8s │ └── otel-config.yaml └── local │ └── otel-config.yaml ├── exporter ├── Makefile ├── README.md ├── builder.go ├── debugexporter │ ├── Makefile │ ├── README.md │ ├── config.go │ ├── config_test.go │ ├── doc.go │ ├── exporter.go │ ├── exporter_test.go │ ├── factory.go │ ├── factory_test.go │ ├── generated_component_test.go │ ├── generated_package_test.go │ ├── go.mod │ ├── go.sum │ ├── internal │ │ ├── metadata │ │ │ └── generated_status.go │ │ └── normal │ │ │ ├── common.go │ │ │ ├── logs.go │ │ │ ├── logs_test.go │ │ │ ├── metrics.go │ │ │ ├── metrics_test.go │ │ │ ├── traces.go │ │ │ └── traces_test.go │ ├── metadata.yaml │ └── testdata │ │ ├── config_verbosity.yaml │ │ └── config_verbosity_typo.yaml ├── exporter.go ├── exporter_test.go ├── exporterbatcher │ ├── batch_func.go │ ├── config.go │ └── config_test.go ├── exporterhelper │ ├── README.md │ ├── batch_sender.go │ ├── batch_sender_test.go │ ├── common.go │ ├── common_test.go │ ├── constants.go │ ├── doc.go │ ├── documentation.md │ ├── generated_component_telemetry_test.go │ ├── generated_package_test.go │ ├── internal │ │ └── metadata │ │ │ ├── generated_status.go │ │ │ ├── generated_telemetry.go │ │ │ └── generated_telemetry_test.go │ ├── logs.go │ ├── logs_batch.go │ ├── logs_batch_test.go │ ├── logs_test.go │ ├── metadata.yaml │ ├── metrics.go │ ├── metrics_batch.go │ ├── metrics_batch_test.go │ ├── metrics_test.go │ ├── obsexporter.go │ ├── obsexporter_test.go │ ├── obsreport_test.go │ ├── queue_sender.go │ ├── queue_sender_test.go │ ├── request.go │ ├── request_test.go │ ├── retry_sender.go │ ├── retry_sender_test.go │ ├── timeout_sender.go │ ├── timeout_sender_test.go │ ├── traces.go │ ├── traces_batch.go │ ├── traces_batch_test.go │ └── traces_test.go ├── exporterqueue │ ├── config.go │ ├── config_test.go │ └── queue.go ├── exportertest │ ├── contract_checker.go │ ├── contract_checker_test.go │ ├── mock_consumer.go │ ├── mock_consumer_test.go │ ├── nop_exporter.go │ └── nop_exporter_test.go ├── go.mod ├── go.sum ├── internal │ ├── common │ │ ├── factory.go │ │ ├── factory_test.go │ │ ├── logging_exporter.go │ │ ├── logging_exporter_test.go │ │ └── package_test.go │ ├── experr │ │ ├── err.go │ │ └── err_test.go │ ├── exporter.go │ ├── factory.go │ ├── logs.go │ ├── metrics.go │ ├── otlptext │ │ ├── databuffer.go │ │ ├── databuffer_test.go │ │ ├── known_sync_error.go │ │ ├── known_sync_error_other.go │ │ ├── known_sync_error_windows.go │ │ ├── logs.go │ │ ├── logs_test.go │ │ ├── metrics.go │ │ ├── metrics_test.go │ │ ├── package_test.go │ │ ├── sync.go │ │ ├── testdata │ │ │ ├── logs │ │ │ │ ├── embedded_maps.out │ │ │ │ ├── empty.out │ │ │ │ ├── one_record.out │ │ │ │ └── two_records.out │ │ │ ├── metrics │ │ │ │ ├── empty.out │ │ │ │ ├── invalid_metric_type.out │ │ │ │ ├── metrics_with_all_types.out │ │ │ │ └── two_metrics.out │ │ │ └── traces │ │ │ │ ├── empty.out │ │ │ │ └── two_spans.out │ │ ├── traces.go │ │ └── traces_test.go │ ├── queue │ │ ├── bounded_memory_queue.go │ │ ├── bounded_memory_queue_test.go │ │ ├── consumers.go │ │ ├── mock_storage.go │ │ ├── package_test.go │ │ ├── persistent_queue.go │ │ ├── persistent_queue_test.go │ │ ├── queue.go │ │ ├── sized_channel.go │ │ └── sized_channel_test.go │ └── traces.go ├── loggingexporter │ ├── Makefile │ ├── README.md │ ├── config.go │ ├── config_test.go │ ├── doc.go │ ├── factory.go │ ├── factory_test.go │ ├── generated_component_test.go │ ├── generated_package_test.go │ ├── go.mod │ ├── go.sum │ ├── internal │ │ └── metadata │ │ │ └── generated_status.go │ ├── metadata.yaml │ └── testdata │ │ ├── config_loglevel.yaml │ │ ├── config_loglevel_typo.yaml │ │ ├── config_verbosity.yaml │ │ ├── invalid_verbosity_loglevel.yaml │ │ └── loglevel_info.yaml ├── nopexporter │ ├── Makefile │ ├── README.md │ ├── doc.go │ ├── generated_component_test.go │ ├── generated_package_test.go │ ├── go.mod │ ├── go.sum │ ├── internal │ │ └── metadata │ │ │ └── generated_status.go │ ├── metadata.yaml │ ├── nop_exporter.go │ └── nop_exporter_test.go ├── otlpexporter │ ├── Makefile │ ├── README.md │ ├── cfg-schema.yaml │ ├── config.go │ ├── config_test.go │ ├── doc.go │ ├── factory.go │ ├── factory_test.go │ ├── generated_component_test.go │ ├── generated_package_test.go │ ├── go.mod │ ├── go.sum │ ├── internal │ │ └── metadata │ │ │ └── generated_status.go │ ├── metadata.yaml │ ├── otlp.go │ ├── otlp_test.go │ └── testdata │ │ ├── config.yaml │ │ ├── invalid_configs.yaml │ │ ├── test_cert.pem │ │ └── test_key.pem ├── otlphttpexporter │ ├── Makefile │ ├── README.md │ ├── config.go │ ├── config_test.go │ ├── doc.go │ ├── factory.go │ ├── factory_test.go │ ├── generated_component_test.go │ ├── generated_package_test.go │ ├── go.mod │ ├── go.sum │ ├── internal │ │ └── metadata │ │ │ └── generated_status.go │ ├── metadata.yaml │ ├── otlp.go │ ├── otlp_test.go │ └── testdata │ │ ├── bad_empty_config.yaml │ │ ├── bad_invalid_encoding.yaml │ │ ├── config.yaml │ │ └── test_cert.pem └── package_test.go ├── extension ├── Makefile ├── README.md ├── auth │ ├── Makefile │ ├── authtest │ │ ├── mock_clientauth.go │ │ ├── mock_clientauth_test.go │ │ └── package_test.go │ ├── client.go │ ├── client_test.go │ ├── doc.go │ ├── go.mod │ ├── go.sum │ ├── package_test.go │ ├── server.go │ └── server_test.go ├── ballastextension │ ├── Makefile │ ├── README.md │ ├── config.go │ ├── config_test.go │ ├── factory.go │ ├── factory_test.go │ ├── generated_component_test.go │ ├── generated_package_test.go │ ├── go.mod │ ├── go.sum │ ├── internal │ │ └── metadata │ │ │ └── generated_status.go │ ├── memory_ballast.go │ ├── memory_ballast_test.go │ ├── metadata.yaml │ └── testdata │ │ └── config.yaml ├── experimental │ └── storage │ │ ├── Makefile │ │ ├── README.md │ │ ├── doc.go │ │ ├── nop_client.go │ │ └── storage.go ├── extension.go ├── extension_test.go ├── extensiontest │ ├── nop_extension.go │ ├── nop_extension_test.go │ ├── statuswatcher_extension.go │ └── statuswatcher_extension_test.go ├── go.mod ├── go.sum ├── memorylimiterextension │ ├── Makefile │ ├── README.md │ ├── config.go │ ├── factory.go │ ├── factory_test.go │ ├── generated_component_test.go │ ├── generated_package_test.go │ ├── go.mod │ ├── go.sum │ ├── internal │ │ └── metadata │ │ │ └── generated_status.go │ ├── memorylimiter.go │ ├── memorylimiter_test.go │ ├── metadata.yaml │ └── testdata │ │ └── config.yaml ├── package_test.go └── zpagesextension │ ├── Makefile │ ├── README.md │ ├── config.go │ ├── config_test.go │ ├── doc.go │ ├── factory.go │ ├── factory_test.go │ ├── generated_component_test.go │ ├── generated_package_test.go │ ├── go.mod │ ├── go.sum │ ├── internal │ └── metadata │ │ └── generated_status.go │ ├── metadata.yaml │ ├── testdata │ └── config.yaml │ ├── zpagesextension.go │ └── zpagesextension_test.go ├── featuregate ├── Makefile ├── README.md ├── flag.go ├── flag_test.go ├── gate.go ├── gate_test.go ├── go.mod ├── go.sum ├── package_test.go ├── registry.go ├── registry_test.go ├── stage.go └── stage_test.go ├── filter ├── Makefile ├── config.go ├── config_test.go ├── doc.go ├── filter.go ├── go.mod ├── go.sum └── testdata │ ├── config.yaml │ └── config_invalid.yaml ├── go.mod ├── go.sum ├── internal ├── buildscripts │ ├── compare-apidiff.sh │ ├── gen-apidiff.sh │ └── gen-certs.sh ├── cgroups │ ├── cgroup.go │ ├── cgroup_test.go │ ├── cgroups.go │ ├── cgroups_test.go │ ├── doc.go │ ├── errors.go │ ├── mountpoint.go │ ├── mountpoint_test.go │ ├── package_test.go │ ├── subsys.go │ ├── subsys_test.go │ ├── testdata │ │ ├── cgroups │ │ │ ├── cpu │ │ │ │ ├── cpu.cfs_period_us │ │ │ │ └── cpu.cfs_quota_us │ │ │ ├── empty │ │ │ │ └── cpu.cfs_quota_us │ │ │ ├── invalid │ │ │ │ └── cpu.cfs_quota_us │ │ │ ├── memory │ │ │ │ └── memory.limit_in_bytes │ │ │ ├── undefined-period │ │ │ │ └── cpu.cfs_quota_us │ │ │ ├── undefined │ │ │ │ ├── cpu.cfs_period_us │ │ │ │ └── cpu.cfs_quota_us │ │ │ └── v2 │ │ │ │ ├── empty │ │ │ │ └── memory.max │ │ │ │ ├── invalid │ │ │ │ └── memory.max │ │ │ │ ├── memory │ │ │ │ └── memory.max │ │ │ │ └── undefined │ │ │ │ └── memory.max │ │ └── proc │ │ │ ├── cgroups │ │ │ ├── cgroup │ │ │ └── mountinfo │ │ │ ├── invalid-cgroup │ │ │ └── cgroup │ │ │ ├── invalid-mountinfo │ │ │ └── mountinfo │ │ │ ├── untranslatable │ │ │ ├── cgroup │ │ │ └── mountinfo │ │ │ └── v2 │ │ │ ├── cgroupv1 │ │ │ └── mountinfo │ │ │ ├── cgroupv1v2 │ │ │ └── mountinfo │ │ │ └── cgroupv2 │ │ │ └── mountinfo │ └── util_test.go ├── e2e │ ├── Makefile │ ├── consume_contract_test.go │ ├── go.mod │ ├── go.sum │ ├── opaque_test.go │ ├── otlphttp_test.go │ └── package_test.go ├── fanoutconsumer │ ├── logs.go │ ├── logs_test.go │ ├── metrics.go │ ├── metrics_test.go │ ├── package_test.go │ ├── traces.go │ └── traces_test.go ├── globalgates │ ├── Makefile │ ├── globalgates.go │ ├── go.mod │ └── go.sum ├── httphelper │ ├── helper.go │ └── helper_test.go ├── iruntime │ ├── mem_info.go │ ├── mem_info_test.go │ ├── package_test.go │ ├── total_memory_linux.go │ ├── total_memory_linux_test.go │ ├── total_memory_other.go │ └── total_memory_other_test.go ├── localhostgate │ ├── featuregate.go │ └── featuregate_test.go ├── memorylimiter │ ├── config.go │ ├── config_test.go │ ├── memorylimiter.go │ ├── memorylimiter_test.go │ └── testdata │ │ ├── config.yaml │ │ └── negative_unsigned_limits_config.yaml ├── obsreportconfig │ ├── obsmetrics │ │ ├── obs_exporter.go │ │ ├── obs_processor.go │ │ ├── obs_receiver.go │ │ ├── obs_scraper.go │ │ └── obsmetrics.go │ ├── obsreportconfig.go │ └── package_test.go ├── sharedcomponent │ ├── package_test.go │ ├── sharedcomponent.go │ └── sharedcomponent_test.go ├── testutil │ ├── package_test.go │ ├── testutil.go │ └── testutil_test.go └── tools │ ├── Makefile │ ├── empty.go │ ├── go.mod │ ├── go.sum │ ├── semconvkit │ ├── main.go │ └── templates │ │ ├── doc.go.tmpl │ │ └── schema.go.tmpl │ └── tools.go ├── otelcol ├── Makefile ├── buffered_core.go ├── buffered_core_test.go ├── collector.go ├── collector_core.go ├── collector_core_test.go ├── collector_test.go ├── collector_windows.go ├── collector_windows_service_test.go ├── collector_windows_test.go ├── command.go ├── command_components.go ├── command_components_test.go ├── command_test.go ├── command_validate.go ├── command_validate_test.go ├── config.go ├── config_test.go ├── configprovider.go ├── configprovider_test.go ├── factories.go ├── factories_test.go ├── flags.go ├── flags_test.go ├── go.mod ├── go.sum ├── internal │ ├── configunmarshaler │ │ ├── configs.go │ │ ├── configs_test.go │ │ └── package_test.go │ └── grpclog │ │ ├── logger.go │ │ ├── logger_test.go │ │ └── package_test.go ├── otelcoltest │ ├── Makefile │ ├── config.go │ ├── config_test.go │ ├── go.mod │ ├── go.sum │ ├── nop_factories.go │ ├── nop_factories_test.go │ ├── package_test.go │ └── testdata │ │ └── config.yaml ├── package_test.go ├── testdata │ ├── components-output.yaml │ ├── otel-log-to-file.yaml │ ├── otelcol-invalid-components.yaml │ ├── otelcol-invalid-receiver-type.yaml │ ├── otelcol-invalid.yaml │ ├── otelcol-invalidprop.yaml │ ├── otelcol-noaddress.yaml │ ├── otelcol-nometrics.yaml │ ├── otelcol-nop.yaml │ ├── otelcol-statuswatcher.yaml │ ├── otelcol-validprop.yaml │ ├── weak-empty-map-to-empty-array.yaml │ ├── weak-implicit-bool-to-int.yaml │ ├── weak-implicit-bool-to-string.yaml │ ├── weak-implicit-int-to-bool.yaml │ ├── weak-implicit-int-to-string.yaml │ ├── weak-implicit-string-to-bool.yaml │ ├── weak-implicit-string-to-int.yaml │ ├── weak-single-element-to-slice.yaml │ └── weak-slice-of-maps-to-map.yaml ├── unmarshaler.go └── unmarshaler_test.go ├── pdata ├── Makefile ├── README.md ├── go.mod ├── go.sum ├── internal │ ├── .gitignore │ ├── cmd │ │ └── pdatagen │ │ │ ├── internal │ │ │ ├── base_fields.go │ │ │ ├── base_slices.go │ │ │ ├── base_structs.go │ │ │ ├── packages.go │ │ │ ├── pcommon_package.go │ │ │ ├── plog_package.go │ │ │ ├── plogotlp_package.go │ │ │ ├── pmetric_package.go │ │ │ ├── pmetricotlp_package.go │ │ │ ├── pprofile_otlp_package.go │ │ │ ├── pprofile_package.go │ │ │ ├── primitive_slice_structs.go │ │ │ ├── ptrace_package.go │ │ │ └── ptraceotlp_package.go │ │ │ └── main.go │ ├── data │ │ ├── bytesid.go │ │ ├── package_test.go │ │ ├── protogen │ │ │ ├── collector │ │ │ │ ├── logs │ │ │ │ │ └── v1 │ │ │ │ │ │ └── logs_service.pb.go │ │ │ │ ├── metrics │ │ │ │ │ └── v1 │ │ │ │ │ │ └── metrics_service.pb.go │ │ │ │ ├── profiles │ │ │ │ │ └── v1experimental │ │ │ │ │ │ └── profiles_service.pb.go │ │ │ │ └── trace │ │ │ │ │ └── v1 │ │ │ │ │ └── trace_service.pb.go │ │ │ ├── common │ │ │ │ └── v1 │ │ │ │ │ └── common.pb.go │ │ │ ├── logs │ │ │ │ └── v1 │ │ │ │ │ └── logs.pb.go │ │ │ ├── metrics │ │ │ │ └── v1 │ │ │ │ │ └── metrics.pb.go │ │ │ ├── profiles │ │ │ │ └── v1experimental │ │ │ │ │ ├── pprofextended.pb.go │ │ │ │ │ └── profiles.pb.go │ │ │ ├── resource │ │ │ │ └── v1 │ │ │ │ │ └── resource.pb.go │ │ │ └── trace │ │ │ │ └── v1 │ │ │ │ └── trace.pb.go │ │ ├── spanid.go │ │ ├── spanid_test.go │ │ ├── traceid.go │ │ └── traceid_test.go │ ├── generated_wrapper_byteslice.go │ ├── generated_wrapper_float64slice.go │ ├── generated_wrapper_instrumentationscope.go │ ├── generated_wrapper_int64slice.go │ ├── generated_wrapper_resource.go │ ├── generated_wrapper_stringslice.go │ ├── generated_wrapper_uint64slice.go │ ├── json │ │ ├── attribute.go │ │ ├── attribute_test.go │ │ ├── enum.go │ │ ├── enum_test.go │ │ ├── json.go │ │ ├── number.go │ │ ├── number_test.go │ │ ├── package_test.go │ │ ├── resource.go │ │ ├── resource_test.go │ │ ├── scope.go │ │ └── scope_test.go │ ├── otlp │ │ ├── logs.go │ │ ├── logs_test.go │ │ ├── metrics.go │ │ ├── metrics_test.go │ │ ├── package_test.go │ │ ├── traces.go │ │ └── traces_test.go │ ├── state.go │ ├── wrapper_logs.go │ ├── wrapper_map.go │ ├── wrapper_metrics.go │ ├── wrapper_profiles.go │ ├── wrapper_slice.go │ ├── wrapper_traces.go │ ├── wrapper_tracestate.go │ └── wrapper_value.go ├── pcommon │ ├── generated_byteslice.go │ ├── generated_byteslice_test.go │ ├── generated_float64slice.go │ ├── generated_float64slice_test.go │ ├── generated_instrumentationscope.go │ ├── generated_instrumentationscope_test.go │ ├── generated_int64slice.go │ ├── generated_int64slice_test.go │ ├── generated_resource.go │ ├── generated_resource_test.go │ ├── generated_stringslice.go │ ├── generated_stringslice_test.go │ ├── generated_uint64slice.go │ ├── generated_uint64slice_test.go │ ├── map.go │ ├── map_test.go │ ├── package_test.go │ ├── slice.go │ ├── slice_test.go │ ├── spanid.go │ ├── spanid_test.go │ ├── timestamp.go │ ├── timestamp_test.go │ ├── trace_state.go │ ├── trace_state_test.go │ ├── traceid.go │ ├── traceid_test.go │ ├── value.go │ └── value_test.go ├── plog │ ├── encoding.go │ ├── fuzz_test.go │ ├── generated_logrecord.go │ ├── generated_logrecord_test.go │ ├── generated_logrecordslice.go │ ├── generated_logrecordslice_test.go │ ├── generated_resourcelogs.go │ ├── generated_resourcelogs_test.go │ ├── generated_resourcelogsslice.go │ ├── generated_resourcelogsslice_test.go │ ├── generated_scopelogs.go │ ├── generated_scopelogs_test.go │ ├── generated_scopelogsslice.go │ ├── generated_scopelogsslice_test.go │ ├── json.go │ ├── json_test.go │ ├── log_record_flags.go │ ├── log_record_flags_test.go │ ├── logs.go │ ├── logs_test.go │ ├── package_test.go │ ├── pb.go │ ├── pb_test.go │ ├── plogotlp │ │ ├── fuzz_test.go │ │ ├── generated_exportpartialsuccess.go │ │ ├── generated_exportpartialsuccess_test.go │ │ ├── grpc.go │ │ ├── grpc_test.go │ │ ├── package_test.go │ │ ├── request.go │ │ ├── request_test.go │ │ ├── response.go │ │ └── response_test.go │ ├── severity_number.go │ └── severity_number_test.go ├── pmetric │ ├── aggregation_temporality.go │ ├── aggregation_temporality_test.go │ ├── encoding.go │ ├── exemplar_value_type.go │ ├── exemplar_value_type_test.go │ ├── fuzz_test.go │ ├── generated_exemplar.go │ ├── generated_exemplar_test.go │ ├── generated_exemplarslice.go │ ├── generated_exemplarslice_test.go │ ├── generated_exponentialhistogram.go │ ├── generated_exponentialhistogram_test.go │ ├── generated_exponentialhistogramdatapoint.go │ ├── generated_exponentialhistogramdatapoint_test.go │ ├── generated_exponentialhistogramdatapointbuckets.go │ ├── generated_exponentialhistogramdatapointbuckets_test.go │ ├── generated_exponentialhistogramdatapointslice.go │ ├── generated_exponentialhistogramdatapointslice_test.go │ ├── generated_gauge.go │ ├── generated_gauge_test.go │ ├── generated_histogram.go │ ├── generated_histogram_test.go │ ├── generated_histogramdatapoint.go │ ├── generated_histogramdatapoint_test.go │ ├── generated_histogramdatapointslice.go │ ├── generated_histogramdatapointslice_test.go │ ├── generated_metric.go │ ├── generated_metric_test.go │ ├── generated_metricslice.go │ ├── generated_metricslice_test.go │ ├── generated_numberdatapoint.go │ ├── generated_numberdatapoint_test.go │ ├── generated_numberdatapointslice.go │ ├── generated_numberdatapointslice_test.go │ ├── generated_resourcemetrics.go │ ├── generated_resourcemetrics_test.go │ ├── generated_resourcemetricsslice.go │ ├── generated_resourcemetricsslice_test.go │ ├── generated_scopemetrics.go │ ├── generated_scopemetrics_test.go │ ├── generated_scopemetricsslice.go │ ├── generated_scopemetricsslice_test.go │ ├── generated_sum.go │ ├── generated_sum_test.go │ ├── generated_summary.go │ ├── generated_summary_test.go │ ├── generated_summarydatapoint.go │ ├── generated_summarydatapoint_test.go │ ├── generated_summarydatapointslice.go │ ├── generated_summarydatapointslice_test.go │ ├── generated_summarydatapointvalueatquantile.go │ ├── generated_summarydatapointvalueatquantile_test.go │ ├── generated_summarydatapointvalueatquantileslice.go │ ├── generated_summarydatapointvalueatquantileslice_test.go │ ├── json.go │ ├── json_test.go │ ├── metric_data_point_flags.go │ ├── metric_data_point_flags_test.go │ ├── metric_type.go │ ├── metric_type_test.go │ ├── metrics.go │ ├── metrics_test.go │ ├── number_data_point_value_type.go │ ├── number_data_point_value_type_test.go │ ├── package_test.go │ ├── pb.go │ ├── pb_test.go │ └── pmetricotlp │ │ ├── fuzz_test.go │ │ ├── generated_exportpartialsuccess.go │ │ ├── generated_exportpartialsuccess_test.go │ │ ├── grpc.go │ │ ├── grpc_test.go │ │ ├── package_test.go │ │ ├── request.go │ │ ├── request_test.go │ │ ├── response.go │ │ └── response_test.go ├── pprofile │ ├── Makefile │ ├── generated_attributeunit.go │ ├── generated_attributeunit_test.go │ ├── generated_attributeunitslice.go │ ├── generated_attributeunitslice_test.go │ ├── generated_function.go │ ├── generated_function_test.go │ ├── generated_functionslice.go │ ├── generated_functionslice_test.go │ ├── generated_label.go │ ├── generated_label_test.go │ ├── generated_labelslice.go │ ├── generated_labelslice_test.go │ ├── generated_line.go │ ├── generated_line_test.go │ ├── generated_lineslice.go │ ├── generated_lineslice_test.go │ ├── generated_link.go │ ├── generated_link_test.go │ ├── generated_linkslice.go │ ├── generated_linkslice_test.go │ ├── generated_location.go │ ├── generated_location_test.go │ ├── generated_locationslice.go │ ├── generated_locationslice_test.go │ ├── generated_mapping.go │ ├── generated_mapping_test.go │ ├── generated_mappingslice.go │ ├── generated_mappingslice_test.go │ ├── generated_profile.go │ ├── generated_profile_test.go │ ├── generated_profilecontainer.go │ ├── generated_profilecontainer_test.go │ ├── generated_profilescontainersslice.go │ ├── generated_profilescontainersslice_test.go │ ├── generated_resourceprofiles.go │ ├── generated_resourceprofiles_test.go │ ├── generated_resourceprofilesslice.go │ ├── generated_resourceprofilesslice_test.go │ ├── generated_sample.go │ ├── generated_sample_test.go │ ├── generated_sampleslice.go │ ├── generated_sampleslice_test.go │ ├── generated_scopeprofiles.go │ ├── generated_scopeprofiles_test.go │ ├── generated_scopeprofilesslice.go │ ├── generated_scopeprofilesslice_test.go │ ├── generated_valuetype.go │ ├── generated_valuetype_test.go │ ├── generated_valuetypeslice.go │ ├── generated_valuetypeslice_test.go │ ├── go.mod │ ├── go.sum │ ├── pprofileotlp │ │ ├── generated_exportpartialsuccess.go │ │ └── generated_exportpartialsuccess_test.go │ ├── profiles.go │ └── profiles_test.go ├── ptrace │ ├── encoding.go │ ├── fuzz_test.go │ ├── generated_resourcespans.go │ ├── generated_resourcespans_test.go │ ├── generated_resourcespansslice.go │ ├── generated_resourcespansslice_test.go │ ├── generated_scopespans.go │ ├── generated_scopespans_test.go │ ├── generated_scopespansslice.go │ ├── generated_scopespansslice_test.go │ ├── generated_span.go │ ├── generated_span_test.go │ ├── generated_spanevent.go │ ├── generated_spanevent_test.go │ ├── generated_spaneventslice.go │ ├── generated_spaneventslice_test.go │ ├── generated_spanlink.go │ ├── generated_spanlink_test.go │ ├── generated_spanlinkslice.go │ ├── generated_spanlinkslice_test.go │ ├── generated_spanslice.go │ ├── generated_spanslice_test.go │ ├── generated_status.go │ ├── generated_status_test.go │ ├── json.go │ ├── json_test.go │ ├── package_test.go │ ├── pb.go │ ├── pb_test.go │ ├── ptraceotlp │ │ ├── fuzz_test.go │ │ ├── generated_exportpartialsuccess.go │ │ ├── generated_exportpartialsuccess_test.go │ │ ├── grpc.go │ │ ├── grpc_test.go │ │ ├── package_test.go │ │ ├── request.go │ │ ├── request_test.go │ │ ├── response.go │ │ └── response_test.go │ ├── span_kind.go │ ├── span_kind_test.go │ ├── status_code.go │ ├── status_code_test.go │ ├── traces.go │ └── traces_test.go └── testdata │ ├── Makefile │ ├── common.go │ ├── go.mod │ ├── go.sum │ ├── log.go │ ├── metric.go │ ├── profile.go │ ├── resource.go │ └── trace.go ├── processor ├── Makefile ├── README.md ├── batchprocessor │ ├── Makefile │ ├── README.md │ ├── batch_processor.go │ ├── batch_processor_test.go │ ├── config.go │ ├── config_test.go │ ├── documentation.md │ ├── factory.go │ ├── factory_test.go │ ├── generated_component_telemetry_test.go │ ├── generated_component_test.go │ ├── generated_package_test.go │ ├── go.mod │ ├── go.sum │ ├── internal │ │ └── metadata │ │ │ ├── generated_status.go │ │ │ ├── generated_telemetry.go │ │ │ └── generated_telemetry_test.go │ ├── metadata.yaml │ ├── metrics.go │ ├── splitlogs.go │ ├── splitlogs_test.go │ ├── splitmetrics.go │ ├── splitmetrics_test.go │ ├── splittraces.go │ ├── splittraces_test.go │ └── testdata │ │ └── config.yaml ├── builder.go ├── go.mod ├── go.sum ├── internal │ ├── factory.go │ ├── logs.go │ ├── metrics.go │ ├── processor.go │ └── traces.go ├── memorylimiterprocessor │ ├── Makefile │ ├── README.md │ ├── config.go │ ├── factory.go │ ├── factory_test.go │ ├── generated_component_test.go │ ├── generated_package_test.go │ ├── go.mod │ ├── go.sum │ ├── internal │ │ ├── metadata │ │ │ └── generated_status.go │ │ ├── mock_exporter.go │ │ └── mock_receiver.go │ ├── memorylimiter.go │ ├── memorylimiter_test.go │ └── metadata.yaml ├── package_test.go ├── processor.go ├── processor_test.go ├── processorhelper │ ├── documentation.md │ ├── generated_component_telemetry_test.go │ ├── generated_package_test.go │ ├── internal │ │ └── metadata │ │ │ ├── generated_telemetry.go │ │ │ └── generated_telemetry_test.go │ ├── logs.go │ ├── logs_test.go │ ├── metadata.yaml │ ├── metrics.go │ ├── metrics_test.go │ ├── obsreport.go │ ├── obsreport_test.go │ ├── processor.go │ ├── traces.go │ └── traces_test.go └── processortest │ ├── nop_processor.go │ ├── nop_processor_test.go │ ├── package_test.go │ ├── shutdown_verifier.go │ ├── shutdown_verifier_test.go │ ├── unhealthy_processor.go │ └── unhealthy_processor_test.go ├── proto_patch.sed ├── receiver ├── Makefile ├── README.md ├── builder.go ├── doc.go ├── go.mod ├── go.sum ├── internal │ ├── factory.go │ ├── logs.go │ ├── metrics.go │ ├── receiver.go │ └── traces.go ├── nopreceiver │ ├── Makefile │ ├── README.md │ ├── doc.go │ ├── generated_component_test.go │ ├── generated_package_test.go │ ├── go.mod │ ├── go.sum │ ├── internal │ │ └── metadata │ │ │ └── generated_status.go │ ├── metadata.yaml │ ├── nop_receiver.go │ └── nop_receiver_test.go ├── otlpreceiver │ ├── Makefile │ ├── README.md │ ├── config.go │ ├── config.md │ ├── config_test.go │ ├── doc.go │ ├── encoder.go │ ├── factory.go │ ├── factory_test.go │ ├── generated_component_test.go │ ├── generated_package_test.go │ ├── go.mod │ ├── go.sum │ ├── internal │ │ ├── errors │ │ │ ├── errors.go │ │ │ └── errors_test.go │ │ ├── logs │ │ │ ├── otlp.go │ │ │ ├── otlp_test.go │ │ │ └── package_test.go │ │ ├── metadata │ │ │ └── generated_status.go │ │ ├── metrics │ │ │ ├── otlp.go │ │ │ ├── otlp_test.go │ │ │ └── package_test.go │ │ └── trace │ │ │ ├── otlp.go │ │ │ ├── otlp_test.go │ │ │ └── package_test.go │ ├── metadata.yaml │ ├── otlp.go │ ├── otlp_test.go │ ├── otlphttp.go │ └── testdata │ │ ├── bad_no_proto_config.yaml │ │ ├── bad_proto_config.yaml │ │ ├── config.yaml │ │ ├── default.yaml │ │ ├── invalid_logs_path.yaml │ │ ├── invalid_metrics_path.yaml │ │ ├── invalid_traces_path.yaml │ │ ├── only_grpc.yaml │ │ ├── only_http.yaml │ │ ├── only_http_empty_map.yaml │ │ ├── only_http_null.yaml │ │ ├── typo_default_proto_config.yaml │ │ └── uds.yaml ├── package_test.go ├── receiver.go ├── receiver_test.go ├── receiverhelper │ ├── documentation.md │ ├── generated_component_telemetry_test.go │ ├── generated_package_test.go │ ├── internal │ │ └── metadata │ │ │ ├── generated_telemetry.go │ │ │ └── generated_telemetry_test.go │ ├── metadata.yaml │ ├── obsreport.go │ └── obsreport_test.go ├── receivertest │ ├── contract_checker.go │ ├── contract_checker_test.go │ ├── nop_receiver.go │ ├── nop_receiver_test.go │ └── package_test.go ├── scrapererror │ ├── doc.go │ ├── package_test.go │ ├── partialscrapeerror.go │ ├── partialscrapeerror_test.go │ ├── scrapeerror.go │ └── scrapeerror_test.go └── scraperhelper │ ├── config.go │ ├── config_test.go │ ├── doc.go │ ├── documentation.md │ ├── generated_component_telemetry_test.go │ ├── generated_package_test.go │ ├── internal │ └── metadata │ │ ├── generated_telemetry.go │ │ └── generated_telemetry_test.go │ ├── metadata.yaml │ ├── obsreport.go │ ├── obsreport_test.go │ ├── scraper.go │ ├── scrapercontroller.go │ └── scrapercontroller_test.go ├── renovate.json ├── semconv ├── Makefile ├── README.md ├── go.mod ├── go.sum ├── package_test.go ├── semconv_test.go ├── template.j2 ├── v1.10.0 │ ├── generated_resource.go │ ├── generated_trace.go │ ├── nonstandard.go │ └── schema.go ├── v1.11.0 │ ├── generated_resource.go │ ├── generated_trace.go │ ├── nonstandard.go │ └── schema.go ├── v1.12.0 │ ├── generated_resource.go │ ├── generated_trace.go │ ├── nonstandard.go │ └── schema.go ├── v1.13.0 │ ├── generated_resource.go │ ├── generated_trace.go │ ├── nonstandard.go │ └── schema.go ├── v1.16.0 │ ├── generated_resource.go │ ├── generated_trace.go │ ├── nonstandard.go │ └── schema.go ├── v1.17.0 │ ├── generated_event.go │ ├── generated_resource.go │ ├── generated_trace.go │ └── schema.go ├── v1.18.0 │ ├── generated_event.go │ ├── generated_resource.go │ ├── generated_trace.go │ └── schema.go ├── v1.21.0 │ ├── doc.go │ ├── generated_event.go │ ├── generated_resource.go │ ├── generated_trace.go │ └── schema.go ├── v1.22.0 │ ├── doc.go │ ├── generated_event.go │ ├── generated_resource.go │ ├── generated_trace.go │ └── schema.go ├── v1.25.0 │ ├── doc.go │ ├── generated_attribute_group.go │ ├── generated_event.go │ ├── generated_resource.go │ ├── generated_trace.go │ └── schema.go ├── v1.5.0 │ ├── generated_resource.go │ ├── generated_trace.go │ ├── nonstandard.go │ └── schema.go ├── v1.6.1 │ ├── generated_resource.go │ ├── generated_trace.go │ ├── nonstandard.go │ └── schema.go ├── v1.7.0 │ ├── generated_resource.go │ ├── generated_trace.go │ ├── nonstandard.go │ └── schema.go ├── v1.8.0 │ ├── generated_resource.go │ ├── generated_trace.go │ ├── nonstandard.go │ └── schema.go └── v1.9.0 │ ├── generated_resource.go │ ├── generated_trace.go │ ├── nonstandard.go │ └── schema.go ├── service ├── Makefile ├── README.md ├── config.go ├── config_test.go ├── documentation.md ├── extensions │ ├── config.go │ ├── extensions.go │ ├── extensions_test.go │ ├── graph.go │ ├── graph_test.go │ └── package_test.go ├── generated_component_telemetry_test.go ├── generated_package_test.go ├── go.mod ├── go.sum ├── host.go ├── internal │ ├── capabilityconsumer │ │ ├── capabilities.go │ │ ├── capabilities_test.go │ │ └── package_test.go │ ├── components │ │ ├── loggers.go │ │ └── package_test.go │ ├── graph │ │ ├── graph.go │ │ ├── graph_test.go │ │ ├── nodes.go │ │ ├── package_test.go │ │ └── zpages.go │ ├── metadata │ │ ├── generated_telemetry.go │ │ └── generated_telemetry_test.go │ ├── proctelemetry │ │ ├── config.go │ │ ├── config_test.go │ │ ├── process_telemetry.go │ │ ├── process_telemetry_linux_test.go │ │ └── process_telemetry_test.go │ ├── resource │ │ ├── config.go │ │ └── config_test.go │ ├── servicetelemetry │ │ ├── nop_telemetry_settings.go │ │ ├── nop_telemetry_settings_test.go │ │ ├── package_test.go │ │ ├── telemetry_settings.go │ │ └── telemetry_settings_test.go │ ├── status │ │ ├── package_test.go │ │ ├── status.go │ │ ├── status_test.go │ │ └── statustest │ │ │ ├── statustest.go │ │ │ └── statustest_test.go │ ├── testcomponents │ │ ├── example_connector.go │ │ ├── example_connector_test.go │ │ ├── example_exporter.go │ │ ├── example_exporter_test.go │ │ ├── example_processor.go │ │ ├── example_processor_test.go │ │ ├── example_receiver.go │ │ ├── example_receiver_test.go │ │ ├── example_router.go │ │ ├── example_router_test.go │ │ ├── package_test.go │ │ └── stateful_component.go │ └── zpages │ │ ├── package_test.go │ │ ├── templates.go │ │ ├── templates │ │ ├── component_header.html │ │ ├── extensions_table.html │ │ ├── features_table.html │ │ ├── page_footer.html │ │ ├── page_header.html │ │ ├── pipelines_table.html │ │ └── properties_table.html │ │ └── templates_test.go ├── metadata.yaml ├── pipelines │ ├── config.go │ ├── config_test.go │ └── package_test.go ├── service.go ├── service_test.go ├── telemetry.go ├── telemetry │ ├── config.go │ ├── config_test.go │ ├── factory.go │ ├── internal │ │ └── factory.go │ ├── logger.go │ ├── package_test.go │ ├── telemetry.go │ ├── telemetry_test.go │ ├── tracer.go │ └── tracer_test.go ├── telemetry_test.go └── zpages.go └── versions.yaml /.chloggen/jpkroehling-add-query-params-to-authcontext-api.yaml: -------------------------------------------------------------------------------- 1 | change_type: 'enhancement' 2 | component: confighttp 3 | note: Add option to include query params in auth context 4 | issues: [4806] 5 | -------------------------------------------------------------------------------- /.chloggen/jpkroehling-add-query-params-to-authcontext.yaml: -------------------------------------------------------------------------------- 1 | change_type: 'breaking' 2 | component: confighttp 3 | note: Auth data type signature has changed 4 | subtext: | 5 | As part of the linked PR, the `auth` attribute was moved from `configauth.Authentication` 6 | to a new `AuthConfig`, which contains a `configauth.Authentication`. For end-users, this 7 | is a non-breaking change. For users of the API, create a new AuthConfig using the 8 | `configauth.Authentication` instance that was being used before. 9 | issues: [4806] 10 | change_logs: [api] 11 | -------------------------------------------------------------------------------- /.chloggen/jpkroehling-grpc-statuscode.yaml: -------------------------------------------------------------------------------- 1 | # One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' 2 | change_type: 'enhancement' 3 | 4 | # The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) 5 | component: configgrpc 6 | 7 | # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). 8 | note: gRPC auth errors now return gRPC status code UNAUTHENTICATED (16) 9 | 10 | # One or more tracking issues or pull requests related to the change 11 | issues: [7646] 12 | 13 | -------------------------------------------------------------------------------- /.codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | branch: main 3 | # only use the latest copy on main branch 4 | strict_yaml_branch: main 5 | 6 | coverage: 7 | precision: 2 8 | round: down 9 | range: "80...100" 10 | status: 11 | project: 12 | default: 13 | enabled: yes 14 | target: 90% 15 | patch: 16 | default: 17 | enabled: yes 18 | target: 95% 19 | 20 | ignore: 21 | - "pdata/internal/data/protogen/**/*" 22 | - "cmd/mdatagen/third_party/**/*" 23 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # This file is documented at https://git-scm.com/docs/gitattributes. 2 | # Linguist-specific attributes are documented at 3 | # https://github.com/github/linguist. 4 | 5 | go.sum linguist-generated=true 6 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | ##################################################### 2 | # 3 | # List of approvers for OpenTelemetry Collector 4 | # 5 | ##################################################### 6 | # 7 | # Learn about membership in OpenTelemetry community: 8 | # https://github.com/open-telemetry/community/blob/main/community-membership.md 9 | # 10 | # 11 | # Learn about CODEOWNERS file format: 12 | # https://help.github.com/en/articles/about-code-owners 13 | # 14 | 15 | * @open-telemetry/collector-approvers 16 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 3 | #### Description 4 | 5 | 6 | #### Link to tracking issue 7 | Fixes # 8 | 9 | 10 | #### Testing 11 | 12 | 13 | #### Documentation 14 | 15 | 16 | -------------------------------------------------------------------------------- /.github/workflows/check_links_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "ignorePatterns": [ 3 | { 4 | "pattern": "http(s)?://\\d+\\.\\d+\\.\\d+\\.\\d+" 5 | }, 6 | { 7 | "pattern": "http(s)?://localhost" 8 | }, 9 | { 10 | "pattern": "http(s)?://example.com" 11 | }, 12 | { 13 | "pattern": "#warnings" 14 | } 15 | ], 16 | "aliveStatusCodes": [429, 200], 17 | "httpHeaders": [ 18 | { 19 | "urls": ["https://docs.github.com/"], 20 | "headers": { 21 | "Accept-Encoding": "zstd, br, gzip, deflate" 22 | } 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /.github/workflows/scripts/release-check-blockers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | # 3 | # Copyright The OpenTelemetry Authors 4 | # SPDX-License-Identifier: Apache-2.0 5 | 6 | BLOCKERS=$( gh issue list --search "label:release:blocker" --json url --jq '.[].url' --repo "${REPO}" ) 7 | if [ "${BLOCKERS}" != "" ]; then 8 | echo "Release blockers in ${REPO} repo: ${BLOCKERS}" 9 | exit 1 10 | fi 11 | -------------------------------------------------------------------------------- /.github/workflows/scripts/release-check-build-status.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | # 3 | # Copyright The OpenTelemetry Authors 4 | # SPDX-License-Identifier: Apache-2.0 5 | 6 | BRANCH=main 7 | WORKFLOW=build-and-test 8 | 9 | RESULT=$(gh run list --branch "${BRANCH}" --json status --jq '[.[] | select(.status != "queued" and .status != "in_progress")][0].status' --workflow "${WORKFLOW}" --repo "${REPO}" ) 10 | if [ "${RESULT}" != "completed" ]; then 11 | echo "Build status in ${REPO} is not completed: ${RESULT}" 12 | gh run list --branch "${BRANCH}" --json status,url --jq '[.[] | select(.status != "queued" and .status != "in_progress")][0].url' --workflow "${WORKFLOW}" --repo "${REPO}" 13 | exit 1 14 | fi 15 | -------------------------------------------------------------------------------- /.github/workflows/shellcheck.yml: -------------------------------------------------------------------------------- 1 | name: Shellcheck lint 2 | on: 3 | push: 4 | branches: [ main ] 5 | pull_request: 6 | branches: [ main ] 7 | 8 | permissions: 9 | contents: read 10 | 11 | jobs: 12 | shellcheck: 13 | name: Shellcheck 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 17 | - name: Run ShellCheck 18 | uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # 2.0.0 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | dist/ 3 | .tools/ 4 | 5 | # GoLand IDEA 6 | /.idea/ 7 | *.iml 8 | 9 | # VS Code 10 | .vscode/ 11 | .devcontainer/ 12 | 13 | # Emacs 14 | *~ 15 | \#*\# 16 | 17 | # Miscellaneous files 18 | *.sw[op] 19 | *.DS_Store 20 | 21 | # Coverage 22 | coverage/* 23 | coverage.txt 24 | 25 | # Benchmarks 26 | benchmarks.txt 27 | 28 | # Wix 29 | *.wixobj 30 | *.wixpdb 31 | 32 | # golang 33 | go.work* 34 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/opentelemetry-collector/ff9ae6b3f34bb9625e9fcb3a060ec02d891b9452/.gitmodules -------------------------------------------------------------------------------- /client/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package client 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /cmd/builder/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | 3 | .PHONY: ocb 4 | ocb: 5 | CGO_ENABLED=0 $(GOCMD) build -trimpath -o ../../bin/ocb_$(GOOS)_$(GOARCH) . 6 | 7 | # Generate the default build config from otelcorecol, by removing the 8 | # "replaces" stanza, which is assumed to be at the end of the file. 9 | # 10 | # The default config file is checked in so that `go install` will work 11 | # and so that non-unix builds don't need sed to be installed. 12 | .PHONY: config 13 | config: internal/config/default.yaml 14 | sed '-e/replaces:/,$$d' <../otelcorecol/builder-config.yaml > internal/config/default.yaml 15 | -------------------------------------------------------------------------------- /cmd/builder/RELEASE.md: -------------------------------------------------------------------------------- 1 | # Releasing the OpenTelemetry Collector Builder 2 | 3 | This project uses [`goreleaser`](https://github.com/goreleaser/goreleaser) to manage the release of new versions. 4 | 5 | To release a new version, simply add a tag named `vX.Y.Z`, like: 6 | 7 | ``` 8 | git tag -a v0.1.1 -m "Release v0.1.1" 9 | git push upstream v0.1.1 10 | ``` 11 | 12 | A new GitHub workflow should be started, and at the end, a GitHub release should have been created, similar with the ["Release v0.56.0"](https://github.com/open-telemetry/opentelemetry-collector/releases/tag/cmd%2Fbuilder%2Fv0.56.0). -------------------------------------------------------------------------------- /cmd/builder/header.txt: -------------------------------------------------------------------------------- 1 | Copyright The OpenTelemetry Authors 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /cmd/builder/internal/builder/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package builder 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /cmd/builder/internal/builder/templates/main_others.go.tmpl: -------------------------------------------------------------------------------- 1 | // Code generated by "go.opentelemetry.io/collector/cmd/builder". DO NOT EDIT. 2 | 3 | //go:build !windows 4 | 5 | package main 6 | 7 | import "go.opentelemetry.io/collector/otelcol" 8 | 9 | func run(params otelcol.CollectorSettings) error { 10 | return runInteractive(params) 11 | } 12 | -------------------------------------------------------------------------------- /cmd/builder/internal/config/default.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package config // import "go.opentelemetry.io/collector/cmd/builder/internal/config" 5 | 6 | import ( 7 | "embed" 8 | 9 | "github.com/knadh/koanf/providers/fs" 10 | "github.com/knadh/koanf/v2" 11 | ) 12 | 13 | //go:embed *.yaml 14 | var configs embed.FS 15 | 16 | // DefaultProvider returns a koanf.Provider that provides the default build 17 | // configuration file. This is the same configuration that otelcorecol is 18 | // built with. 19 | func DefaultProvider() koanf.Provider { 20 | return fs.Provider(configs, "default.yaml") 21 | } 22 | -------------------------------------------------------------------------------- /cmd/builder/internal/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package internal 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /cmd/builder/main.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package main 5 | 6 | import ( 7 | "github.com/spf13/cobra" 8 | 9 | "go.opentelemetry.io/collector/cmd/builder/internal" 10 | ) 11 | 12 | func main() { 13 | cmd, err := internal.Command() 14 | cobra.CheckErr(err) 15 | cobra.CheckErr(cmd.Execute()) 16 | } 17 | -------------------------------------------------------------------------------- /cmd/builder/test/README.md: -------------------------------------------------------------------------------- 1 | # Testing for the OpenTelemetry Collector Builder 2 | 3 | This is a set of end-to-end tests for the builder. As such, it includes only positive tests, based on the manifest files in this directory. Each manifest is expected to be in a working state and should yield an OpenTelemetry Collector instance that is ready within a time interval. "Ready" is defined by calling its healthcheck endpoint. 4 | -------------------------------------------------------------------------------- /cmd/builder/test/core.otel.yaml: -------------------------------------------------------------------------------- 1 | extensions: 2 | zpages: 3 | 4 | receivers: 5 | otlp: 6 | protocols: 7 | grpc: 8 | 9 | processors: 10 | 11 | exporters: 12 | debug: 13 | 14 | service: 15 | extensions: [zpages] 16 | pipelines: 17 | traces: 18 | receivers: 19 | - otlp 20 | processors: [] 21 | exporters: 22 | - debug 23 | -------------------------------------------------------------------------------- /cmd/mdatagen/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /cmd/mdatagen/embeded_templates.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package main 5 | 6 | import "embed" 7 | 8 | // templateFS ensures that the files needed 9 | // to generate metadata as an embedded filesystem since 10 | // `go get` doesn't require these files to be downloaded. 11 | // 12 | //go:embed templates/*.tmpl templates/testdata/*.tmpl 13 | var templateFS embed.FS 14 | -------------------------------------------------------------------------------- /cmd/mdatagen/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package main 4 | 5 | import ( 6 | "testing" 7 | 8 | "go.uber.org/goleak" 9 | ) 10 | 11 | func TestMain(m *testing.M) { 12 | goleak.VerifyTestMain(m) 13 | } 14 | -------------------------------------------------------------------------------- /cmd/mdatagen/internal/samplereceiver/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Generate a test metrics builder from a sample metrics set covering all configuration options. 5 | //go:generate mdatagen metadata.yaml 6 | 7 | // Deprecated: This package is moving to https://github.com/open-telemetry/opentelemetry-collector and will eventually be removed. 8 | // Please see https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/30497 9 | // This is a sample receiver package used to showcase how mdatagen is applied. 10 | package samplereceiver // import "go.opentelemetry.io/collector/cmd/mdatagen/internal/samplereceiver" 11 | -------------------------------------------------------------------------------- /cmd/mdatagen/internal/samplereceiver/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package samplereceiver 4 | 5 | import ( 6 | "testing" 7 | 8 | "go.uber.org/goleak" 9 | ) 10 | 11 | func TestMain(m *testing.M) { 12 | goleak.VerifyTestMain(m) 13 | } 14 | -------------------------------------------------------------------------------- /cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package metadata 4 | 5 | import ( 6 | "go.opentelemetry.io/collector/component" 7 | ) 8 | 9 | var ( 10 | Type = component.MustNewType("sample") 11 | ) 12 | 13 | const ( 14 | LogsStability = component.StabilityLevelDevelopment 15 | TracesStability = component.StabilityLevelBeta 16 | MetricsStability = component.StabilityLevelStable 17 | ) 18 | -------------------------------------------------------------------------------- /cmd/mdatagen/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: mdatagen 2 | 3 | status: 4 | class: cmd 5 | stability: 6 | alpha: [metrics] 7 | codeowners: 8 | active: [dmitryax] -------------------------------------------------------------------------------- /cmd/mdatagen/templates/status.go.tmpl: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package {{ .Package }} 4 | 5 | import ( 6 | "go.opentelemetry.io/collector/component" 7 | ) 8 | 9 | var ( 10 | Type = component.MustNewType("{{ .Type }}") 11 | ) 12 | 13 | const ( 14 | {{- range $stability, $signals := .Status.Stability }} 15 | {{- range $signal := $signals }} 16 | {{ toCamelCase $signal }}Stability = component.StabilityLevel{{ casesTitle $stability.String }} 17 | {{- end }} 18 | {{- end }} 19 | ) 20 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/invalid.yaml: -------------------------------------------------------------------------------- 1 | invalid -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/invalid_aggregation.yaml: -------------------------------------------------------------------------------- 1 | type: metricreceiver 2 | 3 | status: 4 | class: receiver 5 | stability: 6 | development: [logs] 7 | beta: [traces] 8 | stable: [metrics] 9 | distributions: [contrib] 10 | warnings: 11 | - Any additional information that should be brought to the consumer's attention 12 | 13 | metrics: 14 | default.metric: 15 | enabled: true 16 | description: Monotonic cumulative sum int metric enabled by default. 17 | extended_documentation: The metric will be become optional soon. 18 | unit: s 19 | sum: 20 | value_type: int 21 | monotonic: true 22 | aggregation_temporality: invalidaggregation 23 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/invalid_class.yaml: -------------------------------------------------------------------------------- 1 | type: test 2 | 3 | status: 4 | class: incorrectclass 5 | stability: 6 | development: [logs] 7 | beta: [traces] 8 | stable: [metrics] -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/invalid_input_type.yaml: -------------------------------------------------------------------------------- 1 | type: metricreceiver 2 | 3 | status: 4 | class: receiver 5 | stability: 6 | development: [logs] 7 | beta: [traces] 8 | stable: [metrics] 9 | 10 | metrics: 11 | system.cpu.time: 12 | enabled: true 13 | description: Total CPU seconds broken down by different states. 14 | unit: s 15 | sum: 16 | value_type: double 17 | monotonic: true 18 | aggregation_temporality: cumulative 19 | input_type: double 20 | attributes: 21 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/invalid_stability.yaml: -------------------------------------------------------------------------------- 1 | type: file 2 | status: 3 | class: receiver 4 | stability: 5 | incorrectstability: [logs] 6 | beta: [traces] 7 | stable: [metrics] -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/invalid_stability_component.yaml: -------------------------------------------------------------------------------- 1 | type: file 2 | status: 3 | class: receiver 4 | stability: 5 | development: [incorrectcomponent] 6 | beta: [traces] 7 | stable: [metrics] -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/invalid_telemetry_missing_value_type_for_histogram.yaml: -------------------------------------------------------------------------------- 1 | type: metric 2 | 3 | status: 4 | class: receiver 5 | stability: 6 | beta: [traces, logs, metrics] 7 | telemetry: 8 | metrics: 9 | sampling_decision_latency: 10 | description: Latency (in microseconds) of a given sampling policy 11 | unit: µs 12 | enabled: true 13 | histogram: 14 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/invalid_type_attr.yaml: -------------------------------------------------------------------------------- 1 | type: metricreceiver 2 | 3 | sem_conv_version: 1.9.0 4 | 5 | status: 6 | class: receiver 7 | stability: 8 | development: [logs] 9 | beta: [traces] 10 | stable: [metrics] 11 | 12 | attributes: 13 | used_attr: 14 | description: Used attribute. 15 | type: invalidtype 16 | 17 | metrics: 18 | metric: 19 | enabled: true 20 | description: Metric. 21 | unit: "1" 22 | gauge: 23 | value_type: double 24 | attributes: [used_attr] 25 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/invalid_type_rattr.yaml: -------------------------------------------------------------------------------- 1 | type: file 2 | 3 | sem_conv_version: 1.9.0 4 | 5 | status: 6 | class: receiver 7 | stability: 8 | development: [logs] 9 | beta: [traces] 10 | stable: [metrics] 11 | distributions: [contrib] 12 | warnings: 13 | - Any additional information that should be brought to the consumer's attention 14 | 15 | resource_attributes: 16 | string.resource.attr: 17 | description: Resource attribute with any string value. 18 | type: invalidtype 19 | enabled: true 20 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/metrics_and_type.yaml: -------------------------------------------------------------------------------- 1 | type: metricreceiver 2 | 3 | status: 4 | class: receiver 5 | stability: 6 | development: [logs] 7 | beta: [traces] 8 | stable: [metrics] 9 | distributions: [contrib] 10 | warnings: 11 | - Any additional information that should be brought to the consumer's attention 12 | 13 | metrics: 14 | metric: 15 | enabled: true 16 | description: Description. 17 | unit: s 18 | gauge: 19 | value_type: double 20 | 21 | tests: 22 | skip_lifecycle: true 23 | skip_shutdown: true 24 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/no_aggregation.yaml: -------------------------------------------------------------------------------- 1 | type: file 2 | 3 | status: 4 | class: receiver 5 | stability: 6 | development: [logs] 7 | beta: [traces] 8 | stable: [metrics] 9 | distributions: [contrib] 10 | warnings: 11 | - Any additional information that should be brought to the consumer's attention 12 | 13 | 14 | metrics: 15 | default.metric: 16 | enabled: true 17 | description: Monotonic cumulative sum int metric enabled by default. 18 | extended_documentation: The metric will be become optional soon. 19 | unit: s 20 | sum: 21 | value_type: int 22 | monotonic: false -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/no_class.yaml: -------------------------------------------------------------------------------- 1 | type: test 2 | 3 | status: 4 | stability: 5 | development: [logs] 6 | beta: [traces] 7 | stable: [metrics] -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/no_description_rattr.yaml: -------------------------------------------------------------------------------- 1 | type: file 2 | status: 3 | class: receiver 4 | stability: 5 | development: [logs] 6 | beta: [traces] 7 | stable: [metrics] 8 | 9 | resource_attributes: 10 | string.resource.attr: 11 | type: string 12 | enabled: true 13 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/no_enabled.yaml: -------------------------------------------------------------------------------- 1 | type: metricreceiver 2 | 3 | status: 4 | class: receiver 5 | stability: 6 | development: [logs] 7 | beta: [traces] 8 | stable: [metrics] 9 | 10 | metrics: 11 | system.cpu.time: 12 | description: Total CPU seconds broken down by different states. 13 | unit: s 14 | sum: 15 | value_type: double 16 | monotonic: true 17 | aggregation_temporality: cumulative 18 | attributes: 19 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/no_metric_description.yaml: -------------------------------------------------------------------------------- 1 | type: file 2 | 3 | status: 4 | class: receiver 5 | stability: 6 | development: [logs] 7 | beta: [traces] 8 | stable: [metrics] 9 | distributions: [contrib] 10 | warnings: 11 | - Any additional information that should be brought to the consumer's attention 12 | 13 | 14 | metrics: 15 | default.metric: 16 | enabled: true 17 | extended_documentation: The metric will be become optional soon. 18 | unit: s 19 | sum: 20 | value_type: int 21 | monotonic: true 22 | aggregation_temporality: cumulative 23 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/no_metric_type.yaml: -------------------------------------------------------------------------------- 1 | type: metricreceiver 2 | status: 3 | class: receiver 4 | stability: 5 | development: [logs] 6 | beta: [traces] 7 | stable: [metrics] 8 | metrics: 9 | system.cpu.time: 10 | enabled: true 11 | description: Total CPU seconds broken down by different states. 12 | unit: s 13 | attributes: 14 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/no_metric_unit.yaml: -------------------------------------------------------------------------------- 1 | type: file 2 | 3 | status: 4 | class: receiver 5 | stability: 6 | development: [logs] 7 | beta: [traces] 8 | stable: [metrics] 9 | distributions: [contrib] 10 | warnings: 11 | - Any additional information that should be brought to the consumer's attention 12 | 13 | 14 | metrics: 15 | default.metric: 16 | enabled: true 17 | description: Monotonic cumulative sum int metric enabled by default. 18 | extended_documentation: The metric will be become optional soon. 19 | sum: 20 | value_type: int 21 | monotonic: true 22 | aggregation_temporality: cumulative 23 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/no_monotonic.yaml: -------------------------------------------------------------------------------- 1 | type: file 2 | 3 | status: 4 | class: receiver 5 | stability: 6 | development: [logs] 7 | beta: [traces] 8 | stable: [metrics] 9 | distributions: [contrib] 10 | warnings: 11 | - Any additional information that should be brought to the consumer's attention 12 | 13 | 14 | metrics: 15 | default.metric: 16 | enabled: true 17 | description: Monotonic cumulative sum int metric enabled by default. 18 | extended_documentation: The metric will be become optional soon. 19 | unit: s 20 | sum: 21 | value_type: int 22 | aggregation_temporality: cumulative 23 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/no_stability.yaml: -------------------------------------------------------------------------------- 1 | type: test 2 | 3 | status: 4 | class: receiver -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/no_stability_component.yaml: -------------------------------------------------------------------------------- 1 | type: file 2 | status: 3 | class: receiver 4 | stability: 5 | beta: 6 | stable: [metrics] -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/no_status.yaml: -------------------------------------------------------------------------------- 1 | type: test -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/no_type.yaml: -------------------------------------------------------------------------------- 1 | status: 2 | class: receiver 3 | stability: 4 | development: [logs] 5 | beta: [traces] 6 | stable: [metrics] -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/no_type_attr.yaml: -------------------------------------------------------------------------------- 1 | type: metricreceiver 2 | 3 | sem_conv_version: 1.9.0 4 | 5 | status: 6 | class: receiver 7 | stability: 8 | development: [logs] 9 | beta: [traces] 10 | stable: [metrics] 11 | 12 | attributes: 13 | used_attr: 14 | description: Used attribute. 15 | 16 | metrics: 17 | metric: 18 | enabled: true 19 | description: Metric. 20 | unit: "1" 21 | gauge: 22 | value_type: double 23 | attributes: [used_attr] 24 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/no_type_rattr.yaml: -------------------------------------------------------------------------------- 1 | type: file 2 | 3 | sem_conv_version: 1.9.0 4 | 5 | status: 6 | class: receiver 7 | stability: 8 | development: [logs] 9 | beta: [traces] 10 | stable: [metrics] 11 | distributions: [contrib] 12 | warnings: 13 | - Any additional information that should be brought to the consumer's attention 14 | 15 | resource_attributes: 16 | string.resource.attr: 17 | description: Resource attribute with any string value. 18 | enabled: true -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/no_value_type.yaml: -------------------------------------------------------------------------------- 1 | type: metricreceiver 2 | 3 | status: 4 | class: receiver 5 | stability: 6 | development: [logs] 7 | beta: [traces] 8 | stable: [metrics] 9 | distributions: [contrib] 10 | warnings: 11 | - Any additional information that should be brought to the consumer's attention 12 | 13 | 14 | metrics: 15 | system.cpu.time: 16 | enabled: true 17 | description: Total CPU seconds broken down by different states. 18 | unit: s 19 | sum: 20 | monotonic: true 21 | aggregation_temporality: cumulative 22 | attributes: 23 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/parent.yaml: -------------------------------------------------------------------------------- 1 | type: subcomponent 2 | 3 | parent: parentComponent -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/readme_with_multiple_signals.md: -------------------------------------------------------------------------------- 1 | # Some component 2 | 3 | 4 | | Status | | 5 | | ------------- |-----------| 6 | | Stability | [alpha]: logs | 7 | | | [beta]: metrics | 8 | | Distributions | [contrib] | 9 | 10 | [alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha 11 | [beta]: https://github.com/open-telemetry/opentelemetry-collector#beta 12 | [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib 13 | 14 | 15 | Some info about a component 16 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/readme_with_warnings.md: -------------------------------------------------------------------------------- 1 | # Some component 2 | 3 | 4 | | Status | | 5 | | ------------- |-----------| 6 | | Stability | [beta]: metrics | 7 | | Distributions | [contrib] | 8 | | Warnings | [warning1](#warnings) | 9 | 10 | [beta]: https://github.com/open-telemetry/opentelemetry-collector#beta 11 | [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib 12 | 13 | 14 | Some info about a component 15 | ### warnings 16 | Some warning there. 17 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/readme_without_status.md: -------------------------------------------------------------------------------- 1 | # Some component 2 | 3 | Some info about a component 4 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/resource_attributes_only.yaml: -------------------------------------------------------------------------------- 1 | type: test 2 | 3 | status: 4 | class: receiver 5 | stability: 6 | development: [logs] 7 | beta: [traces] 8 | stable: [metrics] 9 | distributions: [contrib] 10 | warnings: 11 | - Any additional information that should be brought to the consumer's attention 12 | 13 | resource_attributes: 14 | res.attr1: 15 | description: Resource attribute 1. 16 | type: string 17 | enabled: true 18 | 19 | tests: 20 | skip_lifecycle: true 21 | skip_shutdown: true 22 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/status_only.yaml: -------------------------------------------------------------------------------- 1 | type: metricreceiver 2 | status: 3 | class: exporter 4 | stability: 5 | beta: [traces, metrics, logs] 6 | distributions: [contrib] 7 | 8 | tests: 9 | skip_lifecycle: true 10 | skip_shutdown: true 11 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/two_metric_types.yaml: -------------------------------------------------------------------------------- 1 | type: metricreceiver 2 | 3 | status: 4 | class: receiver 5 | stability: 6 | development: [logs] 7 | beta: [traces] 8 | stable: [metrics] 9 | 10 | metrics: 11 | system.cpu.time: 12 | enabled: true 13 | description: Total CPU seconds broken down by different states. 14 | unit: s 15 | gauge: 16 | value_type: double 17 | sum: 18 | value_type: double 19 | monotonic: true 20 | aggregation_temporality: cumulative 21 | attributes: 22 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/unknown_metric_attribute.yaml: -------------------------------------------------------------------------------- 1 | type: metricreceiver 2 | 3 | status: 4 | class: receiver 5 | stability: 6 | development: [logs] 7 | beta: [traces] 8 | stable: [metrics] 9 | 10 | metrics: 11 | system.cpu.time: 12 | enabled: true 13 | description: Total CPU seconds broken down by different states. 14 | unit: s 15 | sum: 16 | value_type: double 17 | monotonic: true 18 | aggregation_temporality: cumulative 19 | attributes: [missing] 20 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/unknown_value_type.yaml: -------------------------------------------------------------------------------- 1 | type: metricreceiver 2 | 3 | status: 4 | class: receiver 5 | stability: 6 | development: [logs] 7 | beta: [traces] 8 | stable: [metrics] 9 | 10 | metrics: 11 | system.cpu.time: 12 | enabled: true 13 | description: Total CPU seconds broken down by different states. 14 | unit: s 15 | sum: 16 | value_type: unknown 17 | monotonic: true 18 | aggregation_temporality: cumulative 19 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/unused_attribute.yaml: -------------------------------------------------------------------------------- 1 | type: metricreceiver 2 | 3 | sem_conv_version: 1.9.0 4 | 5 | status: 6 | class: receiver 7 | stability: 8 | development: [logs] 9 | beta: [traces] 10 | stable: [metrics] 11 | 12 | attributes: 13 | used_attr: 14 | description: Used attribute. 15 | type: string 16 | 17 | unused_attr: 18 | name_override: state 19 | description: Unused attribute. 20 | type: string 21 | 22 | metrics: 23 | metric: 24 | enabled: true 25 | description: Metric. 26 | unit: "1" 27 | gauge: 28 | value_type: double 29 | attributes: [used_attr] 30 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/with_goleak_ignores.yaml: -------------------------------------------------------------------------------- 1 | type: foobar 2 | 3 | status: 4 | class: connector 5 | stability: 6 | beta: [traces_to_metrics, traces_to_traces, traces_to_logs, metrics_to_logs, metrics_to_metrics, metrics_to_traces, logs_to_logs, logs_to_metrics, logs_to_traces] 7 | 8 | tests: 9 | goleak: 10 | ignore: 11 | top: 12 | - "testfunc1" 13 | any: 14 | - "testfunc2" -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/with_goleak_setup.yaml: -------------------------------------------------------------------------------- 1 | type: foobar 2 | 3 | status: 4 | class: connector 5 | stability: 6 | beta: [traces_to_metrics, traces_to_traces, traces_to_logs, metrics_to_logs, metrics_to_metrics, metrics_to_traces, logs_to_logs, logs_to_metrics, logs_to_traces] 7 | 8 | tests: 9 | goleak: 10 | setup: "setupFunc()" -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/with_goleak_skip.yaml: -------------------------------------------------------------------------------- 1 | type: foobar 2 | 3 | status: 4 | class: connector 5 | stability: 6 | beta: [traces_to_metrics, traces_to_traces, traces_to_logs, metrics_to_logs, metrics_to_metrics, metrics_to_traces, logs_to_logs, logs_to_metrics, logs_to_traces] 7 | 8 | tests: 9 | goleak: 10 | skip: true -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/with_goleak_teardown.yaml: -------------------------------------------------------------------------------- 1 | type: foobar 2 | 3 | status: 4 | class: connector 5 | stability: 6 | beta: [traces_to_metrics, traces_to_traces, traces_to_logs, metrics_to_logs, metrics_to_metrics, metrics_to_traces, logs_to_logs, logs_to_metrics, logs_to_traces] 7 | 8 | tests: 9 | goleak: 10 | teardown: "teardownFunc()" -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/with_telemetry.yaml: -------------------------------------------------------------------------------- 1 | type: metric 2 | 3 | status: 4 | class: receiver 5 | stability: 6 | beta: [traces, logs, metrics] 7 | telemetry: 8 | metrics: 9 | sampling_decision_latency: 10 | description: Latency (in microseconds) of a given sampling policy 11 | unit: µs 12 | enabled: true 13 | histogram: 14 | value_type: int 15 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/with_tests_connector.yaml: -------------------------------------------------------------------------------- 1 | type: foobar 2 | 3 | status: 4 | class: connector 5 | stability: 6 | beta: [traces_to_metrics, traces_to_traces, traces_to_logs, metrics_to_logs, metrics_to_metrics, metrics_to_traces, logs_to_logs, logs_to_metrics, logs_to_traces] 7 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/with_tests_exporter.yaml: -------------------------------------------------------------------------------- 1 | type: metric 2 | 3 | status: 4 | class: exporter 5 | stability: 6 | beta: [traces, logs, metrics] 7 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/with_tests_extension.yaml: -------------------------------------------------------------------------------- 1 | type: metric 2 | 3 | status: 4 | class: extension 5 | stability: 6 | beta: [extension] 7 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/with_tests_processor.yaml: -------------------------------------------------------------------------------- 1 | type: metric 2 | 3 | status: 4 | class: processor 5 | stability: 6 | beta: [traces, logs, metrics] 7 | -------------------------------------------------------------------------------- /cmd/mdatagen/testdata/with_tests_receiver.yaml: -------------------------------------------------------------------------------- 1 | type: metric 2 | 3 | status: 4 | class: receiver 5 | stability: 6 | beta: [traces, logs, metrics] 7 | -------------------------------------------------------------------------------- /cmd/otelcorecol/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /cmd/otelcorecol/README.md: -------------------------------------------------------------------------------- 1 | # `otelcorecol` test binary 2 | 3 | This folder contains the sources for the `otelcorecol` test binary. This binary is intended for internal **TEST PURPOSES ONLY**. The source files in this folder are **NOT** the ones used to build any official OpenTelemetry Collector releases. 4 | Check [open-telemetry/opentelemetry-collector-releases](https://github.com/open-telemetry/opentelemetry-collector-releases) for the official releases. Check the [**`otelcol` folder**](https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol) on that repository for the official Collector core manifest. 5 | -------------------------------------------------------------------------------- /cmd/otelcorecol/main_others.go: -------------------------------------------------------------------------------- 1 | // Code generated by "go.opentelemetry.io/collector/cmd/builder". DO NOT EDIT. 2 | 3 | //go:build !windows 4 | 5 | package main 6 | 7 | import "go.opentelemetry.io/collector/otelcol" 8 | 9 | func run(params otelcol.CollectorSettings) error { 10 | return runInteractive(params) 11 | } 12 | -------------------------------------------------------------------------------- /component/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.Common 2 | -------------------------------------------------------------------------------- /component/componentprofiles/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /component/componentprofiles/config.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package componentprofiles // import "go.opentelemetry.io/collector/component/componentprofiles" 5 | 6 | import "go.opentelemetry.io/collector/component" 7 | 8 | func mustNewDataType(strType string) component.DataType { 9 | return component.MustNewType(strType) 10 | } 11 | 12 | var ( 13 | // DataTypeProfiles is the data type tag for profiles. 14 | DataTypeProfiles = mustNewDataType("profiles") 15 | ) 16 | -------------------------------------------------------------------------------- /component/componenttest/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Package componenttest define types and functions used to help test packages 5 | // implementing the component package interfaces. 6 | package componenttest // import "go.opentelemetry.io/collector/component/componenttest" 7 | -------------------------------------------------------------------------------- /component/componenttest/nop_host_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package componenttest 5 | 6 | import ( 7 | "testing" 8 | 9 | "github.com/stretchr/testify/assert" 10 | "github.com/stretchr/testify/require" 11 | 12 | "go.opentelemetry.io/collector/component" 13 | ) 14 | 15 | func TestNewNopHost(t *testing.T) { 16 | nh := NewNopHost() 17 | require.NotNil(t, nh) 18 | require.IsType(t, &nopHost{}, nh) 19 | 20 | assert.Nil(t, nh.GetExtensions()) 21 | assert.Nil(t, nh.GetFactory(component.KindReceiver, component.MustNewType("test"))) 22 | } 23 | -------------------------------------------------------------------------------- /component/componenttest/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package componenttest 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /component/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Package component outlines the components used in the collector 5 | // and provides a foundation for the component’s creation and 6 | // termination process. A component can be either a receiver, exporter, 7 | // processor, an extension, or a connector. 8 | package component // import "go.opentelemetry.io/collector/component" 9 | -------------------------------------------------------------------------------- /component/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package component 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /config/configauth/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /config/configauth/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package configauth 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /config/configcompression/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /config/configcompression/go.mod: -------------------------------------------------------------------------------- 1 | module go.opentelemetry.io/collector/config/configcompression 2 | 3 | go 1.21.0 4 | 5 | require ( 6 | github.com/stretchr/testify v1.9.0 7 | go.uber.org/goleak v1.3.0 8 | ) 9 | 10 | require ( 11 | github.com/davecgh/go-spew v1.1.1 // indirect 12 | github.com/kr/pretty v0.3.1 // indirect 13 | github.com/pmezard/go-difflib v1.0.0 // indirect 14 | github.com/rogpeppe/go-internal v1.10.0 // indirect 15 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect 16 | gopkg.in/yaml.v3 v3.0.1 // indirect 17 | ) 18 | -------------------------------------------------------------------------------- /config/configcompression/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package configcompression 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /config/configgrpc/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /config/configgrpc/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Package configgrpc defines the configuration settings to create 5 | // a gRPC client and server. 6 | package configgrpc // import "go.opentelemetry.io/collector/config/configgrpc" 7 | -------------------------------------------------------------------------------- /config/configgrpc/gzip.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package configgrpc // import "go.opentelemetry.io/collector/config/configgrpc" 5 | 6 | import ( 7 | // Import the gzip package which auto-registers the gzip gRPC compressor. 8 | _ "google.golang.org/grpc/encoding/gzip" 9 | ) 10 | -------------------------------------------------------------------------------- /config/configgrpc/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package configgrpc 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /config/confighttp/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /config/confighttp/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Package confighttp defines the configuration settings 5 | // for creating an HTTP client and server. 6 | package confighttp // import "go.opentelemetry.io/collector/config/confighttp" 7 | -------------------------------------------------------------------------------- /config/confighttp/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package confighttp 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /config/confignet/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /config/confignet/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Package confignet implements the configuration settings for protocols to 5 | // connect and transport data information. 6 | package confignet // import "go.opentelemetry.io/collector/config/confignet" 7 | -------------------------------------------------------------------------------- /config/confignet/go.mod: -------------------------------------------------------------------------------- 1 | module go.opentelemetry.io/collector/config/confignet 2 | 3 | go 1.21.0 4 | 5 | require ( 6 | github.com/stretchr/testify v1.9.0 7 | go.uber.org/goleak v1.3.0 8 | ) 9 | 10 | require ( 11 | github.com/davecgh/go-spew v1.1.1 // indirect 12 | github.com/kr/pretty v0.3.1 // indirect 13 | github.com/pmezard/go-difflib v1.0.0 // indirect 14 | github.com/rogpeppe/go-internal v1.10.0 // indirect 15 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect 16 | gopkg.in/yaml.v3 v3.0.1 // indirect 17 | ) 18 | -------------------------------------------------------------------------------- /config/confignet/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package confignet 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /config/configopaque/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /config/configopaque/go.mod: -------------------------------------------------------------------------------- 1 | module go.opentelemetry.io/collector/config/configopaque 2 | 3 | go 1.21.0 4 | 5 | require ( 6 | github.com/stretchr/testify v1.9.0 7 | go.uber.org/goleak v1.3.0 8 | gopkg.in/yaml.v3 v3.0.1 9 | ) 10 | 11 | require ( 12 | github.com/davecgh/go-spew v1.1.1 // indirect 13 | github.com/kr/pretty v0.3.1 // indirect 14 | github.com/pmezard/go-difflib v1.0.0 // indirect 15 | github.com/rogpeppe/go-internal v1.10.0 // indirect 16 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect 17 | ) 18 | -------------------------------------------------------------------------------- /config/configopaque/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package configopaque 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /config/configretry/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /config/configretry/go.mod: -------------------------------------------------------------------------------- 1 | module go.opentelemetry.io/collector/config/configretry 2 | 3 | go 1.21.0 4 | 5 | require ( 6 | github.com/cenkalti/backoff/v4 v4.3.0 7 | github.com/stretchr/testify v1.9.0 8 | go.uber.org/goleak v1.3.0 9 | ) 10 | 11 | require ( 12 | github.com/davecgh/go-spew v1.1.1 // indirect 13 | github.com/kr/pretty v0.3.1 // indirect 14 | github.com/pmezard/go-difflib v1.0.0 // indirect 15 | github.com/rogpeppe/go-internal v1.10.0 // indirect 16 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect 17 | gopkg.in/yaml.v3 v3.0.1 // indirect 18 | ) 19 | -------------------------------------------------------------------------------- /config/configretry/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package configretry 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /config/configtelemetry/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /config/configtelemetry/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Package configtelemetry defines various telemetry level for configuration. 5 | // It enables every component to have access to telemetry level 6 | // to enable metrics only when necessary. 7 | package configtelemetry // import "go.opentelemetry.io/collector/config/configtelemetry" 8 | -------------------------------------------------------------------------------- /config/configtelemetry/go.mod: -------------------------------------------------------------------------------- 1 | module go.opentelemetry.io/collector/config/configtelemetry 2 | 3 | go 1.21.0 4 | 5 | require ( 6 | github.com/stretchr/testify v1.9.0 7 | go.uber.org/goleak v1.3.0 8 | ) 9 | 10 | require ( 11 | github.com/davecgh/go-spew v1.1.1 // indirect 12 | github.com/kr/pretty v0.3.1 // indirect 13 | github.com/pmezard/go-difflib v1.0.0 // indirect 14 | github.com/rogpeppe/go-internal v1.10.0 // indirect 15 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect 16 | gopkg.in/yaml.v3 v3.0.1 // indirect 17 | ) 18 | -------------------------------------------------------------------------------- /config/configtelemetry/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package configtelemetry 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /config/configtls/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /config/configtls/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Package configtls implements the TLS settings to load and 5 | // configure TLS clients and servers. 6 | package configtls // import "go.opentelemetry.io/collector/config/configtls" 7 | -------------------------------------------------------------------------------- /config/configtls/go.mod: -------------------------------------------------------------------------------- 1 | module go.opentelemetry.io/collector/config/configtls 2 | 3 | go 1.21.0 4 | 5 | require ( 6 | github.com/fsnotify/fsnotify v1.7.0 7 | github.com/stretchr/testify v1.9.0 8 | go.opentelemetry.io/collector/config/configopaque v1.12.0 9 | ) 10 | 11 | require ( 12 | github.com/davecgh/go-spew v1.1.1 // indirect 13 | github.com/kr/text v0.2.0 // indirect 14 | github.com/pmezard/go-difflib v1.0.0 // indirect 15 | golang.org/x/sys v0.14.0 // indirect 16 | gopkg.in/yaml.v3 v3.0.1 // indirect 17 | ) 18 | 19 | replace go.opentelemetry.io/collector/config/configopaque => ../configopaque 20 | -------------------------------------------------------------------------------- /config/configtls/testdata/testCA-bad.txt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | bad certificate 3 | -----END CERTIFICATE----- 4 | -------------------------------------------------------------------------------- /config/internal/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /config/internal/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package internal 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /confmap/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.Common 2 | -------------------------------------------------------------------------------- /confmap/confmaptest/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Package confmaptest helps loading confmap.Conf to test packages implementing using the configuration. 5 | package confmaptest // import "go.opentelemetry.io/collector/confmap/confmaptest" 6 | -------------------------------------------------------------------------------- /confmap/confmaptest/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package confmaptest 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /confmap/confmaptest/provider_settings.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package confmaptest // import "go.opentelemetry.io/collector/confmap/confmaptest" 5 | 6 | import ( 7 | "go.uber.org/zap" 8 | 9 | "go.opentelemetry.io/collector/confmap" 10 | ) 11 | 12 | func NewNopProviderSettings() confmap.ProviderSettings { 13 | return confmap.ProviderSettings{Logger: zap.NewNop()} 14 | } 15 | -------------------------------------------------------------------------------- /confmap/confmaptest/testdata/invalid.yaml: -------------------------------------------------------------------------------- 1 | [invalid, -------------------------------------------------------------------------------- /confmap/confmaptest/testdata/simple.yaml: -------------------------------------------------------------------------------- 1 | floating: 3.14 2 | -------------------------------------------------------------------------------- /confmap/converter/expandconverter/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.Common 2 | -------------------------------------------------------------------------------- /confmap/converter/expandconverter/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package expandconverter 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /confmap/converter/expandconverter/testdata/default-config.yaml: -------------------------------------------------------------------------------- 1 | processors: 2 | batch: 3 | exporters: 4 | otlp: 5 | endpoint: "localhost:4317" 6 | -------------------------------------------------------------------------------- /confmap/converter/expandconverter/testdata/errors/expand-list-error.yaml: -------------------------------------------------------------------------------- 1 | test_map: 2 | extra_list: 3 | - "some list value_1" 4 | - "${EXTRA_LIST_^VALUE_2}" 5 | -------------------------------------------------------------------------------- /confmap/converter/expandconverter/testdata/errors/expand-list-map-error.yaml: -------------------------------------------------------------------------------- 1 | test_map: 2 | extra_list_map: 3 | - { recv.1: "some list map value_1",recv.2: "${EXTRA_LIST_MAP_V#ALUE_2}" } 4 | -------------------------------------------------------------------------------- /confmap/converter/expandconverter/testdata/errors/expand-map-error.yaml: -------------------------------------------------------------------------------- 1 | test_map: 2 | extra: "${EX#TRA}" 3 | -------------------------------------------------------------------------------- /confmap/converter/expandconverter/testdata/expand-escaped-env.yaml: -------------------------------------------------------------------------------- 1 | test_map: 2 | # $$ -> escaped $ 3 | recv.1: "$$MAP_VALUE_1" 4 | # $$$ -> escaped $ + substituted env var 5 | recv.2: "$$$MAP_VALUE_2" 6 | # $$$$ -> two escaped $ 7 | recv.3: "$$$$MAP_VALUE_3" 8 | # escaped $ in the middle 9 | recv.4: "some$${MAP_VALUE_4}text" 10 | # two escaped $ 11 | recv.5: "$${ONE}$${TWO}" 12 | # trailing escaped $ 13 | recv.6: "text$$" 14 | # escaped $ alone 15 | recv.7: "$$" 16 | -------------------------------------------------------------------------------- /confmap/converter/expandconverter/testdata/expand-with-all-env.yaml: -------------------------------------------------------------------------------- 1 | test_map: 2 | extra: "$EXTRA" 3 | extra_map: 4 | recv.1: "$EXTRA_MAP_VALUE_1" 5 | recv.2: "${EXTRA_MAP_VALUE_2}" 6 | extra_list_map: 7 | - { recv.1: "$EXTRA_LIST_MAP_VALUE_1",recv.2: "${EXTRA_LIST_MAP_VALUE_2}" } 8 | extra_list: 9 | - "$EXTRA_LIST_VALUE_1" 10 | - "${EXTRA_LIST_VALUE_2}" 11 | 12 | -------------------------------------------------------------------------------- /confmap/converter/expandconverter/testdata/expand-with-no-env.yaml: -------------------------------------------------------------------------------- 1 | test_map: 2 | extra: "some string" 3 | extra_map: 4 | recv.1: "some map value_1" 5 | recv.2: "some map value_2" 6 | extra_list_map: 7 | - { recv.1: "some list map value_1",recv.2: "some list map value_2" } 8 | extra_list: 9 | - "some list value_1" 10 | - "some list value_2" 11 | -------------------------------------------------------------------------------- /confmap/converter/expandconverter/testdata/expand-with-partial-env.yaml: -------------------------------------------------------------------------------- 1 | test_map: 2 | extra: "${EXTRA}" 3 | extra_map: 4 | recv.1: "${EXTRA_MAP_VALUE_1}" 5 | recv.2: "some map value_2" 6 | extra_list_map: 7 | - { recv.1: "some list map value_1",recv.2: "${EXTRA_LIST_MAP_VALUE_2}" } 8 | extra_list: 9 | - "some list value_1" 10 | - "$EXTRA_LIST_VALUE_2" 11 | -------------------------------------------------------------------------------- /confmap/internal/e2e/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.Common 2 | -------------------------------------------------------------------------------- /confmap/internal/e2e/testdata/types_expand.yaml: -------------------------------------------------------------------------------- 1 | field: ${env:ENV} 2 | -------------------------------------------------------------------------------- /confmap/internal/e2e/testdata/types_expand_inline.yaml: -------------------------------------------------------------------------------- 1 | field: "inline field with ${env:ENV} expansion" 2 | -------------------------------------------------------------------------------- /confmap/internal/envvar/pattern.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package envvar // import "go.opentelemetry.io/collector/confmap/internal/envvar" 5 | 6 | import "regexp" 7 | 8 | const ValidationPattern = `^[a-zA-Z_][a-zA-Z0-9_]*$` 9 | 10 | var ValidationRegexp = regexp.MustCompile(ValidationPattern) 11 | -------------------------------------------------------------------------------- /confmap/internal/mapstructure/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package mapstructure 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /confmap/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package confmap 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /confmap/provider/envprovider/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.Common 2 | -------------------------------------------------------------------------------- /confmap/provider/envprovider/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package envprovider 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /confmap/provider/fileprovider/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.Common 2 | -------------------------------------------------------------------------------- /confmap/provider/fileprovider/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package fileprovider 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /confmap/provider/fileprovider/testdata/default-config.yaml: -------------------------------------------------------------------------------- 1 | processors: 2 | batch: 3 | exporters: 4 | otlp: 5 | endpoint: "localhost:4317" 6 | -------------------------------------------------------------------------------- /confmap/provider/fileprovider/testdata/invalid-yaml.yaml: -------------------------------------------------------------------------------- 1 | [invalid, -------------------------------------------------------------------------------- /confmap/provider/httpprovider/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.Common 2 | -------------------------------------------------------------------------------- /confmap/provider/httpprovider/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package httpprovider 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /confmap/provider/httpprovider/provider_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package httpprovider 5 | 6 | import ( 7 | "context" 8 | "testing" 9 | 10 | "github.com/stretchr/testify/assert" 11 | "github.com/stretchr/testify/require" 12 | 13 | "go.opentelemetry.io/collector/confmap/confmaptest" 14 | ) 15 | 16 | func TestSupportedScheme(t *testing.T) { 17 | fp := NewFactory().Create(confmaptest.NewNopProviderSettings()) 18 | assert.Equal(t, "http", fp.Scheme()) 19 | require.NoError(t, fp.Shutdown(context.Background())) 20 | } 21 | -------------------------------------------------------------------------------- /confmap/provider/httpsprovider/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.Common 2 | -------------------------------------------------------------------------------- /confmap/provider/httpsprovider/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package httpsprovider 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /confmap/provider/httpsprovider/provider_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package httpsprovider 5 | 6 | import ( 7 | "testing" 8 | 9 | "github.com/stretchr/testify/assert" 10 | 11 | "go.opentelemetry.io/collector/confmap/confmaptest" 12 | ) 13 | 14 | func TestSupportedScheme(t *testing.T) { 15 | fp := NewFactory().Create(confmaptest.NewNopProviderSettings()) 16 | assert.Equal(t, "https", fp.Scheme()) 17 | } 18 | -------------------------------------------------------------------------------- /confmap/provider/internal/configurablehttpprovider/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package configurablehttpprovider 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /confmap/provider/internal/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package internal 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /confmap/provider/yamlprovider/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.Common 2 | -------------------------------------------------------------------------------- /confmap/provider/yamlprovider/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package yamlprovider 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /confmap/testdata/basic_types.yaml: -------------------------------------------------------------------------------- 1 | typed.options: 2 | floating.point.example: 3.14 3 | integer.example: 1234 4 | bool.example: false 5 | string.example: this is a string 6 | nil.example: 7 | -------------------------------------------------------------------------------- /confmap/testdata/config.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | nop: 3 | nop/myreceiver: 4 | 5 | processors: 6 | nop: 7 | nop/myprocessor: 8 | 9 | exporters: 10 | nop: 11 | nop/myexporter: 12 | 13 | extensions: 14 | nop: 15 | nop/myextension: 16 | 17 | service: 18 | extensions: [nop] 19 | pipelines: 20 | traces: 21 | receivers: [nop] 22 | processors: [nop] 23 | exporters: [nop] 24 | -------------------------------------------------------------------------------- /confmap/testdata/embedded_keys.yaml: -------------------------------------------------------------------------------- 1 | typed::options: 2 | floating::point::example: 3.14 3 | integer::example: 1234 4 | bool::example: false 5 | string::example: this is a string 6 | nil::example: 7 | -------------------------------------------------------------------------------- /confmap/testdata/expand-with-all-env.yaml: -------------------------------------------------------------------------------- 1 | test_map: 2 | extra: "${env:EXTRA}" 3 | extra_map: 4 | recv.1: "${env:EXTRA_MAP_VALUE_1}" 5 | recv.2: "${env:EXTRA_MAP_VALUE_2}" 6 | extra_list_map: 7 | - { recv.1: "${env:EXTRA_LIST_MAP_VALUE_1}",recv.2: "${env:EXTRA_LIST_MAP_VALUE_2}" } 8 | extra_list: 9 | - "${env:EXTRA_LIST_VALUE_1}" 10 | - "${env:EXTRA_LIST_VALUE_2}" 11 | 12 | -------------------------------------------------------------------------------- /confmap/testdata/expand-with-no-env.yaml: -------------------------------------------------------------------------------- 1 | test_map: 2 | extra: "some string" 3 | extra_map: 4 | recv.1: "some map value_1" 5 | recv.2: "some map value_2" 6 | extra_list_map: 7 | - { recv.1: "some list map value_1",recv.2: "some list map value_2" } 8 | extra_list: 9 | - "some list value_1" 10 | - "some list value_2" 11 | -------------------------------------------------------------------------------- /confmap/testdata/expand-with-partial-env.yaml: -------------------------------------------------------------------------------- 1 | test_map: 2 | extra: "${env:EXTRA}" 3 | extra_map: 4 | recv.1: "${env:EXTRA_MAP_VALUE_1}" 5 | recv.2: "some map value_2" 6 | extra_list_map: 7 | - { recv.1: "some list map value_1",recv.2: "${env:EXTRA_LIST_MAP_VALUE_2}" } 8 | extra_list: 9 | - "some list value_1" 10 | - "${env:EXTRA_LIST_VALUE_2}" 11 | -------------------------------------------------------------------------------- /connector/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.Common 2 | -------------------------------------------------------------------------------- /connector/connectortest/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package connectortest 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /connector/forwardconnector/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /connector/forwardconnector/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | //go:generate mdatagen metadata.yaml 5 | 6 | // Package forwardconnector passes signals from one pipeline to another. 7 | package forwardconnector // import "go.opentelemetry.io/collector/connector/forwardconnector" 8 | -------------------------------------------------------------------------------- /connector/forwardconnector/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package forwardconnector 4 | 5 | import ( 6 | "testing" 7 | 8 | "go.uber.org/goleak" 9 | ) 10 | 11 | func TestMain(m *testing.M) { 12 | goleak.VerifyTestMain(m) 13 | } 14 | -------------------------------------------------------------------------------- /connector/forwardconnector/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package metadata 4 | 5 | import ( 6 | "go.opentelemetry.io/collector/component" 7 | ) 8 | 9 | var ( 10 | Type = component.MustNewType("forward") 11 | ) 12 | 13 | const ( 14 | TracesToTracesStability = component.StabilityLevelBeta 15 | MetricsToMetricsStability = component.StabilityLevelBeta 16 | LogsToLogsStability = component.StabilityLevelBeta 17 | ) 18 | -------------------------------------------------------------------------------- /connector/forwardconnector/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: forward 2 | 3 | status: 4 | class: connector 5 | stability: 6 | beta: [traces_to_traces, metrics_to_metrics, logs_to_logs] 7 | distributions: [core, contrib, k8s] 8 | -------------------------------------------------------------------------------- /connector/internal/connector.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package internal // import "go.opentelemetry.io/collector/connector/internal" 5 | 6 | import ( 7 | "go.opentelemetry.io/collector/component" 8 | ) 9 | 10 | // Settings configures Connector creators. 11 | type Settings struct { 12 | // ID returns the ID of the component that will be created. 13 | ID component.ID 14 | 15 | component.TelemetrySettings 16 | 17 | // BuildInfo can be used by components for informational purposes 18 | BuildInfo component.BuildInfo 19 | } 20 | -------------------------------------------------------------------------------- /connector/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package connector 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /consumer/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.Common 2 | -------------------------------------------------------------------------------- /consumer/consumererror/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Package consumererror provides wrappers to easily classify errors. This allows 5 | // appropriate action by error handlers without the need to know each individual 6 | // error type/instance. 7 | package consumererror // import "go.opentelemetry.io/collector/consumer/consumererror" 8 | -------------------------------------------------------------------------------- /consumer/consumererror/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package consumererror 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /consumer/consumerprofiles/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /consumer/consumertest/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /consumer/consumertest/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Package consumertest defines types and functions used to help test packages 5 | // implementing the consumer package interfaces. 6 | package consumertest // import "go.opentelemetry.io/collector/consumer/consumertest" 7 | -------------------------------------------------------------------------------- /consumer/consumertest/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package consumertest 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /consumer/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Package consumer contains interfaces that receive and process data. 5 | package consumer // import "go.opentelemetry.io/collector/consumer" 6 | -------------------------------------------------------------------------------- /consumer/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package consumer 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /docs/img/component-status-event-generation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/opentelemetry-collector/ff9ae6b3f34bb9625e9fcb3a060ec02d891b9452/docs/img/component-status-event-generation.png -------------------------------------------------------------------------------- /docs/img/component-status-runtime-states.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/opentelemetry-collector/ff9ae6b3f34bb9625e9fcb3a060ec02d891b9452/docs/img/component-status-runtime-states.png -------------------------------------------------------------------------------- /docs/img/component-status-state-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/opentelemetry-collector/ff9ae6b3f34bb9625e9fcb3a060ec02d891b9452/docs/img/component-status-state-diagram.png -------------------------------------------------------------------------------- /docs/monitoring.md: -------------------------------------------------------------------------------- 1 | # Monitoring 2 | 3 | To learn how to monitor the Collector using its own telemetry, see the [Internal 4 | telemetry] page. 5 | 6 | [Internal telemetry]: 7 | https://opentelemetry.io/docs/collector/internal-telemetry/#use-internal-telemetry-to-monitor-the-collector 8 | -------------------------------------------------------------------------------- /docs/rfcs/README.md: -------------------------------------------------------------------------------- 1 | # Collector RFCs 2 | 3 | This folder contains accepted design documents for the Collector. 4 | Proposals here imply changes only on the OpenTelemetry Collector and not on other parts of OpenTelemetry; if you have a cross-cutting proposal, file an [OTEP][1] instead. 5 | 6 | Accepted RFCs: 7 | 8 | - [OpenTelemetry Collector Processor Exploration](./processing.md) 9 | 10 | [1]: https://github.com/open-telemetry/oteps 11 | -------------------------------------------------------------------------------- /docs/troubleshooting.md: -------------------------------------------------------------------------------- 1 | # Troubleshooting 2 | 3 | To troubleshoot the Collector, see the [Troubleshooting] page. 4 | 5 | [Troubleshooting]: https://opentelemetry.io/docs/collector/troubleshooting/ 6 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | # Examples 2 | 3 | Information on how the examples can be used can be found in the [Getting 4 | Started 5 | documentation](https://opentelemetry.io/docs/collector/getting-started/). 6 | -------------------------------------------------------------------------------- /exporter/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.Common 2 | -------------------------------------------------------------------------------- /exporter/debugexporter/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /exporter/debugexporter/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | //go:generate mdatagen metadata.yaml 5 | 6 | // Package debugexporter exports data to console as logs. 7 | package debugexporter // import "go.opentelemetry.io/collector/exporter/debugexporter" 8 | -------------------------------------------------------------------------------- /exporter/debugexporter/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package debugexporter 4 | 5 | import ( 6 | "testing" 7 | 8 | "go.uber.org/goleak" 9 | ) 10 | 11 | func TestMain(m *testing.M) { 12 | goleak.VerifyTestMain(m) 13 | } 14 | -------------------------------------------------------------------------------- /exporter/debugexporter/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package metadata 4 | 5 | import ( 6 | "go.opentelemetry.io/collector/component" 7 | ) 8 | 9 | var ( 10 | Type = component.MustNewType("debug") 11 | ) 12 | 13 | const ( 14 | TracesStability = component.StabilityLevelDevelopment 15 | MetricsStability = component.StabilityLevelDevelopment 16 | LogsStability = component.StabilityLevelDevelopment 17 | ) 18 | -------------------------------------------------------------------------------- /exporter/debugexporter/internal/normal/common.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package normal // import "go.opentelemetry.io/collector/exporter/debugexporter/internal/normal" 5 | 6 | import ( 7 | "fmt" 8 | 9 | "go.opentelemetry.io/collector/pdata/pcommon" 10 | ) 11 | 12 | // writeAttributes returns a slice of strings in the form "attrKey=attrValue" 13 | func writeAttributes(attributes pcommon.Map) (attributeStrings []string) { 14 | attributes.Range(func(k string, v pcommon.Value) bool { 15 | attribute := fmt.Sprintf("%s=%s", k, v.AsString()) 16 | attributeStrings = append(attributeStrings, attribute) 17 | return true 18 | }) 19 | return attributeStrings 20 | } 21 | -------------------------------------------------------------------------------- /exporter/debugexporter/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: debug 2 | 3 | status: 4 | class: exporter 5 | stability: 6 | development: [traces, metrics, logs] 7 | distributions: [core, contrib, k8s] 8 | warnings: [Unstable Output Format] 9 | -------------------------------------------------------------------------------- /exporter/debugexporter/testdata/config_verbosity.yaml: -------------------------------------------------------------------------------- 1 | verbosity: detailed 2 | sampling_initial: 10 3 | sampling_thereafter: 50 4 | use_internal_logger: false 5 | -------------------------------------------------------------------------------- /exporter/debugexporter/testdata/config_verbosity_typo.yaml: -------------------------------------------------------------------------------- 1 | # Typo in the configuration that assumes that this property is camelcase 2 | verBosity: detailed 3 | -------------------------------------------------------------------------------- /exporter/exporterhelper/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | //go:generate mdatagen metadata.yaml 5 | 6 | // Package exporterhelper provides helper functions for exporters. 7 | package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporterhelper" 8 | -------------------------------------------------------------------------------- /exporter/exporterhelper/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package exporterhelper 4 | 5 | import ( 6 | "testing" 7 | 8 | "go.uber.org/goleak" 9 | ) 10 | 11 | func TestMain(m *testing.M) { 12 | goleak.VerifyTestMain(m) 13 | } 14 | -------------------------------------------------------------------------------- /exporter/exporterhelper/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package metadata 4 | 5 | import ( 6 | "go.opentelemetry.io/collector/component" 7 | ) 8 | 9 | var ( 10 | Type = component.MustNewType("exporterhelper") 11 | ) 12 | 13 | const ( 14 | TracesStability = component.StabilityLevelBeta 15 | MetricsStability = component.StabilityLevelBeta 16 | LogsStability = component.StabilityLevelBeta 17 | ) 18 | -------------------------------------------------------------------------------- /exporter/exporterhelper/timeout_sender_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package exporterhelper 5 | 6 | import ( 7 | "testing" 8 | "time" 9 | 10 | "github.com/stretchr/testify/assert" 11 | ) 12 | 13 | func TestNewDefaultTimeoutSettings(t *testing.T) { 14 | cfg := NewDefaultTimeoutSettings() 15 | assert.NoError(t, cfg.Validate()) 16 | assert.Equal(t, TimeoutSettings{Timeout: 5 * time.Second}, cfg) 17 | } 18 | 19 | func TestInvalidTimeout(t *testing.T) { 20 | cfg := NewDefaultTimeoutSettings() 21 | assert.NoError(t, cfg.Validate()) 22 | cfg.Timeout = -1 23 | assert.Error(t, cfg.Validate()) 24 | } 25 | -------------------------------------------------------------------------------- /exporter/internal/common/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package common 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /exporter/internal/experr/err.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package experr // import "go.opentelemetry.io/collector/exporter/internal/experr" 5 | 6 | import "errors" 7 | 8 | type shutdownErr struct { 9 | err error 10 | } 11 | 12 | func NewShutdownErr(err error) error { 13 | return shutdownErr{err: err} 14 | } 15 | 16 | func (s shutdownErr) Error() string { 17 | return "interrupted due to shutdown: " + s.err.Error() 18 | } 19 | 20 | func (s shutdownErr) Unwrap() error { 21 | return s.err 22 | } 23 | 24 | func IsShutdownErr(err error) bool { 25 | var sdErr shutdownErr 26 | return errors.As(err, &sdErr) 27 | } 28 | -------------------------------------------------------------------------------- /exporter/internal/experr/err_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package experr 5 | 6 | import ( 7 | "errors" 8 | "testing" 9 | 10 | "github.com/stretchr/testify/assert" 11 | "github.com/stretchr/testify/require" 12 | ) 13 | 14 | func TestNewShutdownErr(t *testing.T) { 15 | err := NewShutdownErr(errors.New("some error")) 16 | assert.Equal(t, "interrupted due to shutdown: some error", err.Error()) 17 | } 18 | 19 | func TestIsShutdownErr(t *testing.T) { 20 | err := errors.New("testError") 21 | require.False(t, IsShutdownErr(err)) 22 | err = NewShutdownErr(err) 23 | require.True(t, IsShutdownErr(err)) 24 | } 25 | -------------------------------------------------------------------------------- /exporter/internal/exporter.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package internal // import "go.opentelemetry.io/collector/exporter/internal" 5 | 6 | import "go.opentelemetry.io/collector/component" // Settings configures exporter creators. 7 | type Settings struct { 8 | // ID returns the ID of the component that will be created. 9 | ID component.ID 10 | 11 | component.TelemetrySettings 12 | 13 | // BuildInfo can be used by components for informational purposes 14 | BuildInfo component.BuildInfo 15 | } 16 | -------------------------------------------------------------------------------- /exporter/internal/logs.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package internal // import "go.opentelemetry.io/collector/exporter/internal" 5 | 6 | import ( 7 | "go.opentelemetry.io/collector/component" 8 | "go.opentelemetry.io/collector/consumer" 9 | ) 10 | 11 | // Logs is an exporter that can consume logs. 12 | type Logs interface { 13 | component.Component 14 | consumer.Logs 15 | } 16 | -------------------------------------------------------------------------------- /exporter/internal/metrics.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package internal // import "go.opentelemetry.io/collector/exporter/internal" 5 | 6 | import ( 7 | "go.opentelemetry.io/collector/component" 8 | "go.opentelemetry.io/collector/consumer" 9 | ) 10 | 11 | // Metrics is an exporter that can consume metrics. 12 | type Metrics interface { 13 | component.Component 14 | consumer.Metrics 15 | } 16 | -------------------------------------------------------------------------------- /exporter/internal/otlptext/known_sync_error_other.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | //go:build !linux && !darwin && !windows 5 | 6 | package otlptext // import "go.opentelemetry.io/collector/exporter/internal/otlptext" 7 | 8 | // knownSyncError returns true if the given error is one of the known 9 | // non-actionable errors returned by Sync on Plan 9. 10 | func knownSyncError(err error) bool { 11 | return false 12 | } 13 | -------------------------------------------------------------------------------- /exporter/internal/otlptext/known_sync_error_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | //go:build windows 5 | 6 | package otlptext // import "go.opentelemetry.io/collector/exporter/internal/otlptext" 7 | 8 | import "golang.org/x/sys/windows" 9 | 10 | // knownSyncError returns true if the given error is one of the known 11 | // non-actionable errors returned by Sync on Windows: 12 | // 13 | // - sync /dev/stderr: The handle is invalid. 14 | func knownSyncError(err error) bool { 15 | return err == windows.ERROR_INVALID_HANDLE 16 | } 17 | -------------------------------------------------------------------------------- /exporter/internal/otlptext/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package otlptext 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /exporter/internal/otlptext/testdata/logs/embedded_maps.out: -------------------------------------------------------------------------------- 1 | ResourceLog #0 2 | Resource SchemaURL: 3 | ScopeLogs #0 4 | ScopeLogs SchemaURL: 5 | InstrumentationScope 6 | LogRecord #0 7 | ObservedTimestamp: 1970-01-01 00:00:00 +0000 UTC 8 | Timestamp: 2020-02-11 20:26:13.000000789 +0000 UTC 9 | SeverityText: INFO 10 | SeverityNumber: Info(9) 11 | Body: Map({"key1":"val1","key2":{"key21":"val21","key22":"val22"}}) 12 | Attributes: 13 | -> key1: Map({"key11":"val11","key12":"val12","key13":{"key131":"val131"}}) 14 | -> key2: Str(val2) 15 | Trace ID: 16 | Span ID: 17 | Flags: 0 18 | -------------------------------------------------------------------------------- /exporter/internal/otlptext/testdata/logs/empty.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/opentelemetry-collector/ff9ae6b3f34bb9625e9fcb3a060ec02d891b9452/exporter/internal/otlptext/testdata/logs/empty.out -------------------------------------------------------------------------------- /exporter/internal/otlptext/testdata/logs/one_record.out: -------------------------------------------------------------------------------- 1 | ResourceLog #0 2 | Resource SchemaURL: 3 | Resource attributes: 4 | -> resource-attr: Str(resource-attr-val-1) 5 | ScopeLogs #0 6 | ScopeLogs SchemaURL: 7 | InstrumentationScope 8 | LogRecord #0 9 | ObservedTimestamp: 1970-01-01 00:00:00 +0000 UTC 10 | Timestamp: 2020-02-11 20:26:13.000000789 +0000 UTC 11 | SeverityText: Info 12 | SeverityNumber: Info(9) 13 | Body: Str(This is a log message) 14 | Attributes: 15 | -> app: Str(server) 16 | -> instance_num: Int(1) 17 | Trace ID: 08040201000000000000000000000000 18 | Span ID: 0102040800000000 19 | Flags: 0 20 | -------------------------------------------------------------------------------- /exporter/internal/otlptext/testdata/metrics/empty.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/opentelemetry-collector/ff9ae6b3f34bb9625e9fcb3a060ec02d891b9452/exporter/internal/otlptext/testdata/metrics/empty.out -------------------------------------------------------------------------------- /exporter/internal/otlptext/testdata/metrics/invalid_metric_type.out: -------------------------------------------------------------------------------- 1 | ResourceMetrics #0 2 | Resource SchemaURL: 3 | Resource attributes: 4 | -> resource-attr: Str(resource-attr-val-1) 5 | ScopeMetrics #0 6 | ScopeMetrics SchemaURL: 7 | InstrumentationScope 8 | Metric #0 9 | Descriptor: 10 | -> Name: sum-int 11 | -> Description: 12 | -> Unit: 1 13 | -> DataType: Empty 14 | -------------------------------------------------------------------------------- /exporter/internal/otlptext/testdata/traces/empty.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/opentelemetry-collector/ff9ae6b3f34bb9625e9fcb3a060ec02d891b9452/exporter/internal/otlptext/testdata/traces/empty.out -------------------------------------------------------------------------------- /exporter/internal/queue/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package queue 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /exporter/internal/traces.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package internal // import "go.opentelemetry.io/collector/exporter/internal" 5 | 6 | import ( 7 | "go.opentelemetry.io/collector/component" 8 | "go.opentelemetry.io/collector/consumer" 9 | ) 10 | 11 | // Traces is an exporter that can consume traces. 12 | type Traces interface { 13 | component.Component 14 | consumer.Traces 15 | } 16 | -------------------------------------------------------------------------------- /exporter/loggingexporter/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /exporter/loggingexporter/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | //go:generate mdatagen metadata.yaml 5 | 6 | // Package loggingexporter exports data to console as logs. 7 | package loggingexporter // import "go.opentelemetry.io/collector/exporter/loggingexporter" 8 | -------------------------------------------------------------------------------- /exporter/loggingexporter/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package loggingexporter 4 | 5 | import ( 6 | "testing" 7 | 8 | "go.uber.org/goleak" 9 | ) 10 | 11 | func TestMain(m *testing.M) { 12 | goleak.VerifyTestMain(m) 13 | } 14 | -------------------------------------------------------------------------------- /exporter/loggingexporter/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package metadata 4 | 5 | import ( 6 | "go.opentelemetry.io/collector/component" 7 | ) 8 | 9 | var ( 10 | Type = component.MustNewType("logging") 11 | ) 12 | 13 | const ( 14 | TracesStability = component.StabilityLevelDeprecated 15 | MetricsStability = component.StabilityLevelDeprecated 16 | LogsStability = component.StabilityLevelDeprecated 17 | ) 18 | -------------------------------------------------------------------------------- /exporter/loggingexporter/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: logging 2 | 3 | status: 4 | class: exporter 5 | stability: 6 | deprecated: [traces, metrics, logs] 7 | distributions: [core, contrib] 8 | -------------------------------------------------------------------------------- /exporter/loggingexporter/testdata/config_loglevel.yaml: -------------------------------------------------------------------------------- 1 | loglevel: debug 2 | sampling_initial: 10 3 | sampling_thereafter: 50 4 | -------------------------------------------------------------------------------- /exporter/loggingexporter/testdata/config_loglevel_typo.yaml: -------------------------------------------------------------------------------- 1 | # Typo in the configuration that assumes that this property is camelcase 2 | logLevel: debug 3 | -------------------------------------------------------------------------------- /exporter/loggingexporter/testdata/config_verbosity.yaml: -------------------------------------------------------------------------------- 1 | verbosity: detailed 2 | sampling_initial: 10 3 | sampling_thereafter: 50 4 | -------------------------------------------------------------------------------- /exporter/loggingexporter/testdata/invalid_verbosity_loglevel.yaml: -------------------------------------------------------------------------------- 1 | loglevel: info 2 | verbosity: detailed 3 | -------------------------------------------------------------------------------- /exporter/loggingexporter/testdata/loglevel_info.yaml: -------------------------------------------------------------------------------- 1 | loglevel: info 2 | -------------------------------------------------------------------------------- /exporter/nopexporter/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /exporter/nopexporter/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | //go:generate mdatagen metadata.yaml 5 | 6 | // Package nopexporter serves as a placeholder exporter. 7 | package nopexporter // import "go.opentelemetry.io/collector/exporter/nopexporter" 8 | -------------------------------------------------------------------------------- /exporter/nopexporter/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package nopexporter 4 | 5 | import ( 6 | "testing" 7 | 8 | "go.uber.org/goleak" 9 | ) 10 | 11 | func TestMain(m *testing.M) { 12 | goleak.VerifyTestMain(m) 13 | } 14 | -------------------------------------------------------------------------------- /exporter/nopexporter/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package metadata 4 | 5 | import ( 6 | "go.opentelemetry.io/collector/component" 7 | ) 8 | 9 | var ( 10 | Type = component.MustNewType("nop") 11 | ) 12 | 13 | const ( 14 | TracesStability = component.StabilityLevelBeta 15 | MetricsStability = component.StabilityLevelBeta 16 | LogsStability = component.StabilityLevelBeta 17 | ) 18 | -------------------------------------------------------------------------------- /exporter/nopexporter/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: nop 2 | 3 | status: 4 | class: exporter 5 | stability: 6 | beta: [traces, metrics, logs] 7 | distributions: [core, contrib, k8s] 8 | -------------------------------------------------------------------------------- /exporter/otlpexporter/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /exporter/otlpexporter/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | //go:generate mdatagen metadata.yaml 5 | 6 | // Package otlpexporter exports data by using the OTLP format to a gPRC endpoint. 7 | package otlpexporter // import "go.opentelemetry.io/collector/exporter/otlpexporter" 8 | -------------------------------------------------------------------------------- /exporter/otlpexporter/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package otlpexporter 4 | 5 | import ( 6 | "testing" 7 | 8 | "go.uber.org/goleak" 9 | ) 10 | 11 | func TestMain(m *testing.M) { 12 | goleak.VerifyTestMain(m) 13 | } 14 | -------------------------------------------------------------------------------- /exporter/otlpexporter/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package metadata 4 | 5 | import ( 6 | "go.opentelemetry.io/collector/component" 7 | ) 8 | 9 | var ( 10 | Type = component.MustNewType("otlp") 11 | ) 12 | 13 | const ( 14 | LogsStability = component.StabilityLevelBeta 15 | TracesStability = component.StabilityLevelStable 16 | MetricsStability = component.StabilityLevelStable 17 | ) 18 | -------------------------------------------------------------------------------- /exporter/otlpexporter/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: otlp 2 | 3 | status: 4 | class: exporter 5 | stability: 6 | stable: [traces, metrics] 7 | beta: [logs] 8 | distributions: [core, contrib, k8s] 9 | 10 | tests: 11 | config: 12 | endpoint: otelcol:4317 -------------------------------------------------------------------------------- /exporter/otlpexporter/testdata/config.yaml: -------------------------------------------------------------------------------- 1 | endpoint: "1.2.3.4:1234" 2 | compression: "gzip" 3 | tls: 4 | ca_file: /var/lib/mycert.pem 5 | timeout: 10s 6 | sending_queue: 7 | enabled: true 8 | num_consumers: 2 9 | queue_size: 10 10 | retry_on_failure: 11 | enabled: true 12 | initial_interval: 10s 13 | randomization_factor: 0.7 14 | multiplier: 1.3 15 | max_interval: 60s 16 | max_elapsed_time: 10m 17 | auth: 18 | authenticator: nop 19 | headers: 20 | "can you have a . here?": "F0000000-0000-0000-0000-000000000000" 21 | header1: "234" 22 | another: "somevalue" 23 | keepalive: 24 | time: 20s 25 | timeout: 30s 26 | permit_without_stream: true 27 | balancer_name: "round_robin" 28 | -------------------------------------------------------------------------------- /exporter/otlphttpexporter/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /exporter/otlphttpexporter/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | //go:generate mdatagen metadata.yaml 5 | 6 | // Package otlphttpexporter exports data by using the OTLP format to an HTTP endpoint. 7 | package otlphttpexporter // import "go.opentelemetry.io/collector/exporter/otlphttpexporter" 8 | -------------------------------------------------------------------------------- /exporter/otlphttpexporter/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package otlphttpexporter 4 | 5 | import ( 6 | "testing" 7 | 8 | "go.uber.org/goleak" 9 | ) 10 | 11 | func TestMain(m *testing.M) { 12 | goleak.VerifyTestMain(m) 13 | } 14 | -------------------------------------------------------------------------------- /exporter/otlphttpexporter/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package metadata 4 | 5 | import ( 6 | "go.opentelemetry.io/collector/component" 7 | ) 8 | 9 | var ( 10 | Type = component.MustNewType("otlphttp") 11 | ) 12 | 13 | const ( 14 | LogsStability = component.StabilityLevelBeta 15 | TracesStability = component.StabilityLevelStable 16 | MetricsStability = component.StabilityLevelStable 17 | ) 18 | -------------------------------------------------------------------------------- /exporter/otlphttpexporter/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: otlphttp 2 | 3 | status: 4 | class: exporter 5 | stability: 6 | stable: [traces, metrics] 7 | beta: [logs] 8 | distributions: [core, contrib, k8s] 9 | 10 | tests: 11 | config: 12 | endpoint: "https://1.2.3.4:1234" 13 | 14 | -------------------------------------------------------------------------------- /exporter/otlphttpexporter/testdata/bad_empty_config.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | nop: 3 | 4 | processors: 5 | nop: 6 | 7 | exporters: 8 | otlphttp: 9 | 10 | service: 11 | pipelines: 12 | traces: 13 | receivers: [nop] 14 | processors: [nop] 15 | exporters: [otlphttp] 16 | -------------------------------------------------------------------------------- /exporter/otlphttpexporter/testdata/bad_invalid_encoding.yaml: -------------------------------------------------------------------------------- 1 | encoding: invalid 2 | -------------------------------------------------------------------------------- /exporter/otlphttpexporter/testdata/config.yaml: -------------------------------------------------------------------------------- 1 | endpoint: "https://1.2.3.4:1234" 2 | tls: 3 | ca_file: /var/lib/mycert.pem 4 | cert_file: certfile 5 | key_file: keyfile 6 | insecure: true 7 | timeout: 10s 8 | read_buffer_size: 123 9 | write_buffer_size: 345 10 | sending_queue: 11 | enabled: true 12 | num_consumers: 2 13 | queue_size: 10 14 | retry_on_failure: 15 | enabled: true 16 | initial_interval: 10s 17 | randomization_factor: 0.7 18 | multiplier: 1.3 19 | max_interval: 60s 20 | max_elapsed_time: 10m 21 | headers: 22 | "can you have a . here?": "F0000000-0000-0000-0000-000000000000" 23 | header1: "234" 24 | another: "somevalue" 25 | compression: gzip 26 | -------------------------------------------------------------------------------- /exporter/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package exporter 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /extension/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.Common 2 | -------------------------------------------------------------------------------- /extension/auth/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /extension/auth/authtest/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package authtest 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /extension/auth/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Package auth implements the configuration settings to 5 | // ensure authentication on incoming requests, and allows 6 | // exporters to add authentication on outgoing requests. 7 | package auth // import "go.opentelemetry.io/collector/extension/auth" 8 | -------------------------------------------------------------------------------- /extension/auth/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package auth 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /extension/ballastextension/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /extension/ballastextension/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package ballastextension 4 | 5 | import ( 6 | "testing" 7 | 8 | "go.uber.org/goleak" 9 | ) 10 | 11 | func TestMain(m *testing.M) { 12 | goleak.VerifyTestMain(m) 13 | } 14 | -------------------------------------------------------------------------------- /extension/ballastextension/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package metadata 4 | 5 | import ( 6 | "go.opentelemetry.io/collector/component" 7 | ) 8 | 9 | var ( 10 | Type = component.MustNewType("memory_ballast") 11 | ) 12 | 13 | const ( 14 | ExtensionStability = component.StabilityLevelDeprecated 15 | ) 16 | -------------------------------------------------------------------------------- /extension/ballastextension/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: memory_ballast 2 | 3 | status: 4 | class: extension 5 | stability: 6 | deprecated: [extension] 7 | distributions: [core, contrib] 8 | -------------------------------------------------------------------------------- /extension/ballastextension/testdata/config.yaml: -------------------------------------------------------------------------------- 1 | size_mib: 123 2 | size_in_percentage: 20 3 | -------------------------------------------------------------------------------- /extension/experimental/storage/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /extension/experimental/storage/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Package storage implements an extension that can 5 | // persist state beyond the collector process. 6 | package storage // import "go.opentelemetry.io/collector/extension/experimental/storage" 7 | -------------------------------------------------------------------------------- /extension/memorylimiterextension/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /extension/memorylimiterextension/config.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package memorylimiterextension // import "go.opentelemetry.io/collector/extension/memorylimiterextension" 5 | 6 | import ( 7 | "go.opentelemetry.io/collector/internal/memorylimiter" 8 | ) 9 | 10 | type Config = memorylimiter.Config 11 | -------------------------------------------------------------------------------- /extension/memorylimiterextension/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package memorylimiterextension 4 | 5 | import ( 6 | "testing" 7 | 8 | "go.uber.org/goleak" 9 | ) 10 | 11 | func TestMain(m *testing.M) { 12 | goleak.VerifyTestMain(m) 13 | } 14 | -------------------------------------------------------------------------------- /extension/memorylimiterextension/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package metadata 4 | 5 | import ( 6 | "go.opentelemetry.io/collector/component" 7 | ) 8 | 9 | var ( 10 | Type = component.MustNewType("memory_limiter") 11 | ) 12 | 13 | const ( 14 | ExtensionStability = component.StabilityLevelDevelopment 15 | ) 16 | -------------------------------------------------------------------------------- /extension/memorylimiterextension/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: memory_limiter 2 | 3 | status: 4 | class: extension 5 | stability: 6 | development: [extension] 7 | distributions: [] 8 | 9 | tests: 10 | config: 11 | check_interval: 5s 12 | limit_mib: 400 13 | spike_limit_mib: 50 14 | # TODO: https://github.com/open-telemetry/opentelemetry-collector/issues/9686 15 | skip_shutdown: true 16 | -------------------------------------------------------------------------------- /extension/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package extension 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /extension/zpagesextension/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /extension/zpagesextension/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | //go:generate mdatagen metadata.yaml 5 | 6 | // Package zpagesextension implements an extension that exposes zPages of 7 | // properly instrumented components. 8 | package zpagesextension // import "go.opentelemetry.io/collector/extension/zpagesextension" 9 | -------------------------------------------------------------------------------- /extension/zpagesextension/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package zpagesextension 4 | 5 | import ( 6 | "testing" 7 | 8 | "go.uber.org/goleak" 9 | ) 10 | 11 | func TestMain(m *testing.M) { 12 | goleak.VerifyTestMain(m) 13 | } 14 | -------------------------------------------------------------------------------- /extension/zpagesextension/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package metadata 4 | 5 | import ( 6 | "go.opentelemetry.io/collector/component" 7 | ) 8 | 9 | var ( 10 | Type = component.MustNewType("zpages") 11 | ) 12 | 13 | const ( 14 | ExtensionStability = component.StabilityLevelBeta 15 | ) 16 | -------------------------------------------------------------------------------- /extension/zpagesextension/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: zpages 2 | 3 | status: 4 | class: extension 5 | stability: 6 | beta: [extension] 7 | distributions: [core, contrib, k8s] 8 | -------------------------------------------------------------------------------- /extension/zpagesextension/testdata/config.yaml: -------------------------------------------------------------------------------- 1 | endpoint: "localhost:56888" 2 | -------------------------------------------------------------------------------- /featuregate/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.Common 2 | -------------------------------------------------------------------------------- /featuregate/go.mod: -------------------------------------------------------------------------------- 1 | module go.opentelemetry.io/collector/featuregate 2 | 3 | go 1.21.0 4 | 5 | require ( 6 | github.com/hashicorp/go-version v1.7.0 7 | github.com/stretchr/testify v1.9.0 8 | go.uber.org/goleak v1.3.0 9 | go.uber.org/multierr v1.11.0 10 | ) 11 | 12 | require ( 13 | github.com/davecgh/go-spew v1.1.1 // indirect 14 | github.com/kr/pretty v0.3.1 // indirect 15 | github.com/pmezard/go-difflib v1.0.0 // indirect 16 | github.com/rogpeppe/go-internal v1.10.0 // indirect 17 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect 18 | gopkg.in/yaml.v3 v3.0.1 // indirect 19 | ) 20 | 21 | retract ( 22 | v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module, use v0.76.1 23 | v0.69.0 // Release failed, use v0.69.1 24 | ) 25 | -------------------------------------------------------------------------------- /featuregate/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package featuregate 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /featuregate/stage_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package featuregate 5 | 6 | import ( 7 | "testing" 8 | 9 | "github.com/stretchr/testify/assert" 10 | ) 11 | 12 | func TestStageString(t *testing.T) { 13 | assert.Equal(t, "Alpha", StageAlpha.String()) 14 | assert.Equal(t, "Beta", StageBeta.String()) 15 | assert.Equal(t, "Stable", StageStable.String()) 16 | assert.Equal(t, "Deprecated", StageDeprecated.String()) 17 | assert.Equal(t, "Unknown", Stage(-1).String()) 18 | } 19 | -------------------------------------------------------------------------------- /filter/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.Common 2 | -------------------------------------------------------------------------------- /filter/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Package filter provides an interface for matching strings against a set of string filters. 5 | package filter // import "go.opentelemetry.io/collector/filter" 6 | -------------------------------------------------------------------------------- /filter/filter.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package filter // import "go.opentelemetry.io/collector/filter" 5 | 6 | // Filter is an interface for matching values against a set of filters. 7 | type Filter interface { 8 | // Matches returns true if the given value matches at least one 9 | // of the filters encapsulated by the Filter. 10 | Matches(any) bool 11 | } 12 | -------------------------------------------------------------------------------- /filter/testdata/config.yaml: -------------------------------------------------------------------------------- 1 | # Yaml form of the configuration for Filters 2 | # This configuration can be embedded into other component's yamls 3 | # The top level here are just test names and do not represent part of the actual configuration. 4 | 5 | regexp/default: 6 | - regexp: "one|two" 7 | strict/default: 8 | - strict: "strict" 9 | -------------------------------------------------------------------------------- /filter/testdata/config_invalid.yaml: -------------------------------------------------------------------------------- 1 | # Yaml form of the configuration for Filters 2 | # This configuration can be embedded into other component's yamls 3 | # The top level here are just test names and do not represent part of the actual configuration. 4 | 5 | invalid/regexp: 6 | - regexp: "(.*[" 7 | invalid/config_empty: 8 | - regexp: "" 9 | strict: "" 10 | invalid/config_both_set: 11 | - regexp: "1" 12 | strict: "1" 13 | -------------------------------------------------------------------------------- /internal/cgroups/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package cgroups 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /internal/cgroups/testdata/cgroups/cpu/cpu.cfs_period_us: -------------------------------------------------------------------------------- 1 | 100000 2 | -------------------------------------------------------------------------------- /internal/cgroups/testdata/cgroups/cpu/cpu.cfs_quota_us: -------------------------------------------------------------------------------- 1 | 600000 2 | -------------------------------------------------------------------------------- /internal/cgroups/testdata/cgroups/empty/cpu.cfs_quota_us: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/opentelemetry-collector/ff9ae6b3f34bb9625e9fcb3a060ec02d891b9452/internal/cgroups/testdata/cgroups/empty/cpu.cfs_quota_us -------------------------------------------------------------------------------- /internal/cgroups/testdata/cgroups/invalid/cpu.cfs_quota_us: -------------------------------------------------------------------------------- 1 | non-an-integer 2 | -------------------------------------------------------------------------------- /internal/cgroups/testdata/cgroups/memory/memory.limit_in_bytes: -------------------------------------------------------------------------------- 1 | 8796093018112 2 | -------------------------------------------------------------------------------- /internal/cgroups/testdata/cgroups/undefined-period/cpu.cfs_quota_us: -------------------------------------------------------------------------------- 1 | 800000 2 | -------------------------------------------------------------------------------- /internal/cgroups/testdata/cgroups/undefined/cpu.cfs_period_us: -------------------------------------------------------------------------------- 1 | 100000 2 | -------------------------------------------------------------------------------- /internal/cgroups/testdata/cgroups/undefined/cpu.cfs_quota_us: -------------------------------------------------------------------------------- 1 | -1 2 | -------------------------------------------------------------------------------- /internal/cgroups/testdata/cgroups/v2/empty/memory.max: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/opentelemetry-collector/ff9ae6b3f34bb9625e9fcb3a060ec02d891b9452/internal/cgroups/testdata/cgroups/v2/empty/memory.max -------------------------------------------------------------------------------- /internal/cgroups/testdata/cgroups/v2/invalid/memory.max: -------------------------------------------------------------------------------- 1 | ngn 2 | -------------------------------------------------------------------------------- /internal/cgroups/testdata/cgroups/v2/memory/memory.max: -------------------------------------------------------------------------------- 1 | 250000000 2 | -------------------------------------------------------------------------------- /internal/cgroups/testdata/cgroups/v2/undefined/memory.max: -------------------------------------------------------------------------------- 1 | max 2 | -------------------------------------------------------------------------------- /internal/cgroups/testdata/proc/cgroups/cgroup: -------------------------------------------------------------------------------- 1 | 3:memory:/docker/large 2 | 2:cpu,cpuacct:/docker 3 | 1:cpuset:/ 4 | -------------------------------------------------------------------------------- /internal/cgroups/testdata/proc/invalid-cgroup/cgroup: -------------------------------------------------------------------------------- 1 | 1:cpu:/cpu 2 | invalid-line: 3 | -------------------------------------------------------------------------------- /internal/cgroups/testdata/proc/invalid-mountinfo/mountinfo: -------------------------------------------------------------------------------- 1 | 1 0 8:1 / / rw,noatime shared:1 - ext4 /dev/sda1 2 | -------------------------------------------------------------------------------- /internal/cgroups/testdata/proc/untranslatable/cgroup: -------------------------------------------------------------------------------- 1 | 1:cpu:/docker 2 | 2:cpuacct:/docker 3 | -------------------------------------------------------------------------------- /internal/cgroups/testdata/proc/untranslatable/mountinfo: -------------------------------------------------------------------------------- 1 | 31 23 0:24 / /sys/fs/cgroup/cpu rw,nosuid,nodev,noexec,relatime shared:1 - cgroup cgroup rw,cpu 2 | 32 23 0:25 /docker/0123456789abcdef /sys/fs/cgroup/cpuacct rw,nosuid,nodev,noexec,relatime shared:2 - cgroup cgroup rw,cpuacct 3 | -------------------------------------------------------------------------------- /internal/cgroups/testdata/proc/v2/cgroupv2/mountinfo: -------------------------------------------------------------------------------- 1 | 34 33 0:29 / /sys/fs/cgroup rw,nosuid,nodev,noexec,relatime shared:10 - cgroup2 cgroup rw,nsdelegate -------------------------------------------------------------------------------- /internal/e2e/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /internal/e2e/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package e2e 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /internal/fanoutconsumer/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package fanoutconsumer 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /internal/globalgates/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /internal/globalgates/go.mod: -------------------------------------------------------------------------------- 1 | module go.opentelemetry.io/collector/internal/globalgates 2 | 3 | go 1.21.0 4 | 5 | require go.opentelemetry.io/collector/featuregate v1.12.0 6 | 7 | require ( 8 | github.com/hashicorp/go-version v1.7.0 // indirect 9 | go.uber.org/multierr v1.11.0 // indirect 10 | ) 11 | 12 | replace go.opentelemetry.io/collector/featuregate => ../../featuregate 13 | -------------------------------------------------------------------------------- /internal/iruntime/mem_info.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package iruntime // import "go.opentelemetry.io/collector/internal/iruntime" 5 | 6 | import ( 7 | "github.com/shirou/gopsutil/v4/mem" 8 | ) 9 | 10 | // readMemInfo returns the total memory 11 | // supports in linux, darwin and windows 12 | func readMemInfo() (uint64, error) { 13 | vmStat, err := mem.VirtualMemory() 14 | return vmStat.Total, err 15 | } 16 | -------------------------------------------------------------------------------- /internal/iruntime/mem_info_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package iruntime 5 | 6 | import ( 7 | "testing" 8 | 9 | "github.com/stretchr/testify/assert" 10 | ) 11 | 12 | func TestReadMemInfo(t *testing.T) { 13 | vmStat, err := readMemInfo() 14 | assert.NoError(t, err) 15 | assert.True(t, vmStat > 0) 16 | } 17 | -------------------------------------------------------------------------------- /internal/iruntime/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package iruntime 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /internal/iruntime/total_memory_linux_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | //go:build linux 5 | 6 | package iruntime 7 | 8 | import ( 9 | "testing" 10 | 11 | "github.com/stretchr/testify/assert" 12 | "github.com/stretchr/testify/require" 13 | ) 14 | 15 | func TestTotalMemory(t *testing.T) { 16 | totalMemory, err := TotalMemory() 17 | require.NoError(t, err) 18 | assert.True(t, totalMemory > 0) 19 | } 20 | -------------------------------------------------------------------------------- /internal/iruntime/total_memory_other.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | //go:build !linux 5 | 6 | package iruntime // import "go.opentelemetry.io/collector/internal/iruntime" 7 | 8 | // TotalMemory returns total available memory for non-linux platforms. 9 | func TotalMemory() (uint64, error) { 10 | return readMemInfo() 11 | } 12 | -------------------------------------------------------------------------------- /internal/iruntime/total_memory_other_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | //go:build !linux 5 | 6 | package iruntime 7 | 8 | import ( 9 | "testing" 10 | 11 | "github.com/stretchr/testify/assert" 12 | ) 13 | 14 | func TestTotalMemory(t *testing.T) { 15 | totalMemory, err := TotalMemory() 16 | assert.NoError(t, err) 17 | assert.True(t, totalMemory > 0) 18 | } 19 | -------------------------------------------------------------------------------- /internal/memorylimiter/testdata/config.yaml: -------------------------------------------------------------------------------- 1 | # check_interval is the time between measurements of memory usage for the 2 | # purposes of avoiding going over the limits. Defaults to zero, so no 3 | # checks will be performed. Values below 1 second are not recommended since 4 | # it can result in unnecessary CPU consumption. 5 | check_interval: 5s 6 | 7 | # Maximum amount of memory, in MiB, targeted to be allocated by the process heap. 8 | # Note that typically the total memory usage of process will be about 50MiB higher 9 | # than this value. 10 | limit_mib: 4000 11 | 12 | # The maximum, in MiB, spike expected between the measurements of memory usage. 13 | spike_limit_mib: 500 14 | -------------------------------------------------------------------------------- /internal/memorylimiter/testdata/negative_unsigned_limits_config.yaml: -------------------------------------------------------------------------------- 1 | # check_interval is the time between measurements of memory usage for the 2 | # purposes of avoiding going over the limits. Defaults to zero, so no 3 | # checks will be performed. Values below 1 second are not recommended since 4 | # it can result in unnecessary CPU consumption. 5 | check_interval: 5s 6 | 7 | # Maximum amount of memory, in MiB, targeted to be allocated by the process heap. 8 | # Note that typically the total memory usage of process will be about 50MiB higher 9 | # than this value. 10 | limit_mib: -2000 11 | 12 | # The maximum, in MiB, spike expected between the measurements of memory usage. 13 | spike_limit_mib: -2300 14 | -------------------------------------------------------------------------------- /internal/obsreportconfig/obsmetrics/obsmetrics.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Package obsmetrics defines the obsreport metrics for each components 5 | // all the metrics is in OpenCensus format which will be replaced with OTEL Metrics 6 | // in the future 7 | package obsmetrics // import "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" 8 | 9 | const ( 10 | SpanNameSep = "/" 11 | MetricNameSep = "_" 12 | Scope = "go.opentelemetry.io/collector/obsreport" 13 | ) 14 | -------------------------------------------------------------------------------- /internal/obsreportconfig/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package obsreportconfig 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /internal/sharedcomponent/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package sharedcomponent 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /internal/testutil/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package testutil 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /internal/tools/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /internal/tools/empty.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package tools // import "go.opentelemetry.io/collector/internal/tools" 5 | -------------------------------------------------------------------------------- /internal/tools/semconvkit/templates/doc.go.tmpl: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Package semconv implements OpenTelemetry semantic conventions. 5 | // 6 | // OpenTelemetry semantic conventions are agreed standardized naming 7 | // patterns for OpenTelemetry things. This package represents the {{.TagVer}} 8 | // version of the OpenTelemetry semantic conventions. 9 | package semconv // import "go.opentelemetry.io/collector/semconv/{{.TagVer}}" 10 | -------------------------------------------------------------------------------- /internal/tools/semconvkit/templates/schema.go.tmpl: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/{{.TagVer}}" 5 | 6 | // SchemaURL is the schema URL that matches the version of the semantic conventions 7 | // that this package defines. Semconv packages starting from v1.4.0 must declare 8 | // non-empty schema URL in the form https://opentelemetry.io/schemas/ 9 | const SchemaURL = "https://opentelemetry.io/schemas/{{.SemVer}}" 10 | -------------------------------------------------------------------------------- /otelcol/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.Common 2 | -------------------------------------------------------------------------------- /otelcol/internal/configunmarshaler/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package configunmarshaler 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /otelcol/internal/grpclog/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package grpclog 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /otelcol/otelcoltest/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /otelcol/otelcoltest/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package otelcoltest 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /otelcol/otelcoltest/testdata/config.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | nop: 3 | nop/myreceiver: 4 | 5 | processors: 6 | nop: 7 | nop/myprocessor: 8 | 9 | exporters: 10 | nop: 11 | nop/myexporter: 12 | 13 | connectors: 14 | nop/myconnector: 15 | 16 | extensions: 17 | nop: 18 | nop/myextension: 19 | 20 | service: 21 | extensions: [nop] 22 | pipelines: 23 | traces: 24 | receivers: [nop] 25 | processors: [nop] 26 | exporters: [nop] 27 | -------------------------------------------------------------------------------- /otelcol/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package otelcol 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /otelcol/testdata/otel-log-to-file.yaml: -------------------------------------------------------------------------------- 1 | extensions: 2 | zpages: 3 | 4 | receivers: 5 | otlp: 6 | protocols: 7 | grpc: 8 | http: 9 | 10 | exporters: 11 | debug: 12 | verbosity: detailed 13 | 14 | service: 15 | telemetry: 16 | logs: 17 | level: info 18 | output_paths: 19 | # The folder need to be created prior to starting the collector 20 | - ${ProgramData}\OpenTelemetry\Collector\Logs\otelcol.log 21 | 22 | pipelines: 23 | traces: 24 | receivers: [otlp] 25 | exporters: [debug] 26 | metrics: 27 | receivers: [otlp] 28 | exporters: [debug] 29 | 30 | extensions: [zpages] 31 | -------------------------------------------------------------------------------- /otelcol/testdata/otelcol-invalid-components.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | nop: 3 | exporters: 4 | nop: 5 | processors: 6 | nosuchprocessor: 7 | service: 8 | pipelines: 9 | traces: 10 | receivers: [nop] 11 | exporters: [nop] 12 | processors: [nop] 13 | -------------------------------------------------------------------------------- /otelcol/testdata/otelcol-invalid-receiver-type.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | nop_logs: 3 | 4 | processors: 5 | nop: 6 | 7 | exporters: 8 | nop: 9 | 10 | service: 11 | telemetry: 12 | metrics: 13 | address: localhost:8888 14 | pipelines: 15 | traces: 16 | receivers: [nop_logs] 17 | processors: [nop] 18 | exporters: [nop] 19 | -------------------------------------------------------------------------------- /otelcol/testdata/otelcol-invalid.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | nop: 3 | 4 | processors: 5 | nop: 6 | 7 | exporters: 8 | nop: 9 | 10 | service: 11 | telemetry: 12 | metrics: 13 | address: localhost:8888 14 | pipelines: 15 | traces: 16 | receivers: [nop] 17 | processors: [invalid] 18 | exporters: [nop] 19 | -------------------------------------------------------------------------------- /otelcol/testdata/otelcol-invalidprop.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | nop: 3 | 4 | processors: 5 | nop: 6 | 7 | exporters: 8 | nop: 9 | 10 | service: 11 | telemetry: 12 | traces: 13 | propagators: 14 | - "unknown" 15 | - "tracecontext" 16 | metrics: 17 | address: localhost:8888 18 | pipelines: 19 | traces: 20 | receivers: [nop] 21 | processors: [nop] 22 | exporters: [nop] 23 | -------------------------------------------------------------------------------- /otelcol/testdata/otelcol-noaddress.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | nop: 3 | 4 | exporters: 5 | nop: 6 | 7 | service: 8 | telemetry: 9 | metrics: 10 | address: "" 11 | pipelines: 12 | metrics: 13 | receivers: [nop] 14 | exporters: [nop] 15 | -------------------------------------------------------------------------------- /otelcol/testdata/otelcol-nometrics.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | nop: 3 | 4 | exporters: 5 | nop: 6 | 7 | service: 8 | telemetry: 9 | metrics: 10 | level: none 11 | pipelines: 12 | metrics: 13 | receivers: [nop] 14 | exporters: [nop] 15 | -------------------------------------------------------------------------------- /otelcol/testdata/otelcol-nop.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | nop: 3 | 4 | processors: 5 | nop: 6 | 7 | exporters: 8 | nop: 9 | 10 | extensions: 11 | nop: 12 | 13 | connectors: 14 | nop/con: 15 | 16 | service: 17 | telemetry: 18 | metrics: 19 | address: localhost:8888 20 | extensions: [nop] 21 | pipelines: 22 | traces: 23 | receivers: [nop] 24 | processors: [nop] 25 | exporters: [nop, nop/con] 26 | metrics: 27 | receivers: [nop] 28 | processors: [nop] 29 | exporters: [nop] 30 | logs: 31 | receivers: [nop, nop/con] 32 | processors: [nop] 33 | exporters: [nop] 34 | -------------------------------------------------------------------------------- /otelcol/testdata/otelcol-statuswatcher.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | nop: 3 | 4 | processors: 5 | nop: 6 | unhealthy: 7 | 8 | exporters: 9 | nop: 10 | 11 | extensions: 12 | statuswatcher: 13 | 14 | service: 15 | telemetry: 16 | metrics: 17 | address: localhost:8888 18 | extensions: [statuswatcher] 19 | pipelines: 20 | traces: 21 | receivers: [nop] 22 | processors: [nop,unhealthy] 23 | exporters: [nop] 24 | metrics: 25 | receivers: [nop] 26 | processors: [nop,unhealthy] 27 | exporters: [nop] 28 | logs: 29 | receivers: [nop] 30 | processors: [nop,unhealthy] 31 | exporters: [nop] 32 | -------------------------------------------------------------------------------- /otelcol/testdata/otelcol-validprop.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | nop: 3 | 4 | processors: 5 | nop: 6 | 7 | exporters: 8 | nop: 9 | 10 | service: 11 | telemetry: 12 | traces: 13 | propagators: 14 | - "b3" 15 | - "tracecontext" 16 | metrics: 17 | address: localhost:8888 18 | pipelines: 19 | traces: 20 | receivers: [nop] 21 | processors: [nop] 22 | exporters: [nop] 23 | -------------------------------------------------------------------------------- /otelcol/testdata/weak-empty-map-to-empty-array.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | nop: 3 | 4 | processors: 5 | nop: 6 | 7 | exporters: 8 | nop: 9 | 10 | extensions: 11 | nop: 12 | 13 | connectors: 14 | nop/con: 15 | 16 | service: 17 | telemetry: 18 | metrics: 19 | address: localhost:8888 20 | extensions: [nop] 21 | pipelines: 22 | traces: 23 | receivers: [nop] 24 | processors: {} # <-- Empty map casted to empty array 25 | exporters: [nop, nop/con] 26 | metrics: 27 | receivers: [nop] 28 | processors: [nop] 29 | exporters: [nop] 30 | logs: 31 | receivers: [nop, nop/con] 32 | processors: [nop] 33 | exporters: [nop] 34 | -------------------------------------------------------------------------------- /otelcol/testdata/weak-implicit-bool-to-int.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | nop: 3 | 4 | processors: 5 | nop: 6 | 7 | exporters: 8 | nop: 9 | 10 | extensions: 11 | nop: 12 | 13 | connectors: 14 | nop/con: 15 | 16 | service: 17 | telemetry: 18 | metrics: 19 | address: localhost:8888 20 | logs: 21 | sampling: 22 | initial: true # <-- Implicit cast bool to int 23 | extensions: [nop] 24 | pipelines: 25 | traces: 26 | receivers: [nop] 27 | processors: [nop] 28 | exporters: [nop, nop/con] 29 | metrics: 30 | receivers: [nop] 31 | processors: [nop] 32 | exporters: [nop] 33 | logs: 34 | receivers: [nop, nop/con] 35 | processors: [nop] 36 | exporters: [nop] 37 | -------------------------------------------------------------------------------- /otelcol/testdata/weak-implicit-bool-to-string.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | nop: 3 | 4 | processors: 5 | nop: 6 | 7 | exporters: 8 | nop: 9 | 10 | extensions: 11 | nop: 12 | 13 | connectors: 14 | nop/con: 15 | 16 | service: 17 | telemetry: 18 | metrics: 19 | address: true # <-- Implicit cast bool to string 20 | extensions: [nop] 21 | pipelines: 22 | traces: 23 | receivers: [nop] 24 | processors: [nop] 25 | exporters: [nop, nop/con] 26 | metrics: 27 | receivers: [nop] 28 | processors: [nop] 29 | exporters: [nop] 30 | logs: 31 | receivers: [nop, nop/con] 32 | processors: [nop] 33 | exporters: [nop] 34 | -------------------------------------------------------------------------------- /otelcol/testdata/weak-implicit-int-to-bool.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | nop: 3 | 4 | processors: 5 | nop: 6 | 7 | exporters: 8 | nop: 9 | 10 | extensions: 11 | nop: 12 | 13 | connectors: 14 | nop/con: 15 | 16 | service: 17 | telemetry: 18 | metrics: 19 | address: localhost:8888 20 | logs: 21 | sampling: 22 | enabled: 1 # <-- Implicit cast int to bool 23 | extensions: [nop] 24 | pipelines: 25 | traces: 26 | receivers: [nop] 27 | processors: [nop] 28 | exporters: [nop, nop/con] 29 | metrics: 30 | receivers: [nop] 31 | processors: [nop] 32 | exporters: [nop] 33 | logs: 34 | receivers: [nop, nop/con] 35 | processors: [nop] 36 | exporters: [nop] 37 | -------------------------------------------------------------------------------- /otelcol/testdata/weak-implicit-int-to-string.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | nop: 3 | 4 | processors: 5 | nop: 6 | 7 | exporters: 8 | nop: 9 | 10 | extensions: 11 | nop: 12 | 13 | connectors: 14 | nop/con: 15 | 16 | service: 17 | telemetry: 18 | metrics: 19 | address: 0xdeadbeef # <-- Implicit cast int to string 20 | extensions: [nop] 21 | pipelines: 22 | traces: 23 | receivers: [nop] 24 | processors: [nop] 25 | exporters: [nop, nop/con] 26 | metrics: 27 | receivers: [nop] 28 | processors: [nop] 29 | exporters: [nop] 30 | logs: 31 | receivers: [nop, nop/con] 32 | processors: [nop] 33 | exporters: [nop] 34 | -------------------------------------------------------------------------------- /otelcol/testdata/weak-implicit-string-to-bool.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | nop: 3 | 4 | processors: 5 | nop: 6 | 7 | exporters: 8 | nop: 9 | 10 | extensions: 11 | nop: 12 | 13 | connectors: 14 | nop/con: 15 | 16 | service: 17 | telemetry: 18 | metrics: 19 | address: localhost:8888 20 | logs: 21 | sampling: 22 | enabled: t # <-- Implicit cast string to bool 23 | extensions: [nop] 24 | pipelines: 25 | traces: 26 | receivers: [nop] 27 | processors: [nop] 28 | exporters: [nop, nop/con] 29 | metrics: 30 | receivers: [nop] 31 | processors: [nop] 32 | exporters: [nop] 33 | logs: 34 | receivers: [nop, nop/con] 35 | processors: [nop] 36 | exporters: [nop] 37 | -------------------------------------------------------------------------------- /otelcol/testdata/weak-single-element-to-slice.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | nop: 3 | 4 | processors: 5 | nop: 6 | 7 | exporters: 8 | nop: 9 | 10 | extensions: 11 | nop: 12 | 13 | connectors: 14 | nop/con: 15 | 16 | service: 17 | telemetry: 18 | metrics: 19 | address: localhost:8888 20 | extensions: nop # <-- Single element casted to slice 21 | pipelines: 22 | traces: 23 | receivers: [nop] 24 | processors: [nop] 25 | exporters: [nop, nop/con] 26 | metrics: 27 | receivers: [nop] 28 | processors: [nop] 29 | exporters: [nop] 30 | logs: 31 | receivers: [nop, nop/con] 32 | processors: [nop] 33 | exporters: [nop] 34 | -------------------------------------------------------------------------------- /otelcol/testdata/weak-slice-of-maps-to-map.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | nop: 3 | 4 | processors: 5 | nop: 6 | 7 | exporters: 8 | nop: 9 | 10 | extensions: 11 | nop: 12 | 13 | connectors: 14 | nop/con: 15 | 16 | service: 17 | telemetry: 18 | metrics: 19 | address: localhost:8888 20 | extensions: [nop] 21 | pipelines: 22 | - traces: # <-- Slice of maps casted to map 23 | receivers: [nop] 24 | processors: [nop] 25 | exporters: [nop, nop/con] 26 | metrics: 27 | receivers: [nop] 28 | processors: [nop] 29 | exporters: [nop] 30 | - logs: 31 | receivers: [nop, nop/con] 32 | processors: [nop] 33 | exporters: [nop] 34 | -------------------------------------------------------------------------------- /pdata/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.Common 2 | -------------------------------------------------------------------------------- /pdata/internal/.gitignore: -------------------------------------------------------------------------------- 1 | .patched-otlp-proto 2 | opentelemetry-proto 3 | -------------------------------------------------------------------------------- /pdata/internal/cmd/pdatagen/main.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package main 5 | 6 | import ( 7 | "go.opentelemetry.io/collector/pdata/internal/cmd/pdatagen/internal" 8 | ) 9 | 10 | func check(e error) { 11 | if e != nil { 12 | panic(e) 13 | } 14 | } 15 | 16 | func main() { 17 | for _, fp := range internal.AllPackages { 18 | check(fp.GenerateFiles()) 19 | check(fp.GenerateTestFiles()) 20 | check(fp.GenerateInternalFiles()) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pdata/internal/data/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package data 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /pdata/internal/json/json.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package json // import "go.opentelemetry.io/collector/pdata/internal/json" 5 | 6 | import ( 7 | "io" 8 | 9 | "github.com/gogo/protobuf/jsonpb" 10 | "github.com/gogo/protobuf/proto" 11 | ) 12 | 13 | var marshaler = &jsonpb.Marshaler{ 14 | // https://github.com/open-telemetry/opentelemetry-specification/pull/2758 15 | EnumsAsInts: true, 16 | // https://github.com/open-telemetry/opentelemetry-specification/pull/2829 17 | OrigName: false, 18 | } 19 | 20 | func Marshal(out io.Writer, pb proto.Message) error { 21 | return marshaler.Marshal(out, pb) 22 | } 23 | -------------------------------------------------------------------------------- /pdata/internal/json/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package json 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /pdata/internal/otlp/logs.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package otlp // import "go.opentelemetry.io/collector/pdata/internal/otlp" 5 | 6 | import ( 7 | otlplogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1" 8 | ) 9 | 10 | // MigrateLogs implements any translation needed due to deprecation in OTLP logs protocol. 11 | // Any plog.Unmarshaler implementation from OTLP (proto/json) MUST call this, and the gRPC Server implementation. 12 | func MigrateLogs(rls []*otlplogs.ResourceLogs) { 13 | for _, rl := range rls { 14 | if len(rl.ScopeLogs) == 0 { 15 | rl.ScopeLogs = rl.DeprecatedScopeLogs 16 | } 17 | rl.DeprecatedScopeLogs = nil 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /pdata/internal/otlp/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package otlp 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /pdata/internal/state.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package internal // import "go.opentelemetry.io/collector/pdata/internal" 5 | 6 | // State defines an ownership state of pmetric.Metrics, plog.Logs or ptrace.Traces. 7 | type State int32 8 | 9 | const ( 10 | // StateMutable indicates that the data is exclusive to the current consumer. 11 | StateMutable State = iota 12 | 13 | // StateReadOnly indicates that the data is shared with other consumers. 14 | StateReadOnly 15 | ) 16 | 17 | // AssertMutable panics if the state is not StateMutable. 18 | func (state *State) AssertMutable() { 19 | if *state != StateMutable { 20 | panic("invalid access to shared data") 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pdata/pcommon/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package pcommon 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /pdata/plog/fuzz_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package plog // import "go.opentelemetry.io/collector/pdata/plog" 5 | 6 | import ( 7 | "testing" 8 | ) 9 | 10 | func FuzzUnmarshalJsonLogs(f *testing.F) { 11 | f.Fuzz(func(_ *testing.T, data []byte) { 12 | u := &JSONUnmarshaler{} 13 | //nolint: errcheck 14 | _, _ = u.UnmarshalLogs(data) 15 | }) 16 | } 17 | 18 | func FuzzUnmarshalPBLogs(f *testing.F) { 19 | f.Fuzz(func(_ *testing.T, data []byte) { 20 | u := &ProtoUnmarshaler{} 21 | //nolint: errcheck 22 | _, _ = u.UnmarshalLogs(data) 23 | }) 24 | } 25 | -------------------------------------------------------------------------------- /pdata/plog/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package plog 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /pdata/plog/plogotlp/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package plogotlp 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /pdata/pmetric/aggregation_temporality_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package pmetric // import "go.opentelemetry.io/collector/pdata/pmetric" 5 | 6 | import ( 7 | "testing" 8 | 9 | "github.com/stretchr/testify/assert" 10 | ) 11 | 12 | func TestAggregationTemporalityString(t *testing.T) { 13 | assert.Equal(t, "Unspecified", AggregationTemporalityUnspecified.String()) 14 | assert.Equal(t, "Delta", AggregationTemporalityDelta.String()) 15 | assert.Equal(t, "Cumulative", AggregationTemporalityCumulative.String()) 16 | assert.Equal(t, "", (AggregationTemporalityCumulative + 1).String()) 17 | } 18 | -------------------------------------------------------------------------------- /pdata/pmetric/exemplar_value_type_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package pmetric // import "go.opentelemetry.io/collector/pdata/pmetric" 5 | 6 | import ( 7 | "testing" 8 | 9 | "github.com/stretchr/testify/assert" 10 | ) 11 | 12 | func TestExemplarValueTypeString(t *testing.T) { 13 | assert.Equal(t, "Empty", ExemplarValueTypeEmpty.String()) 14 | assert.Equal(t, "Int", ExemplarValueTypeInt.String()) 15 | assert.Equal(t, "Double", ExemplarValueTypeDouble.String()) 16 | assert.Equal(t, "", (ExemplarValueTypeDouble + 1).String()) 17 | } 18 | -------------------------------------------------------------------------------- /pdata/pmetric/fuzz_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package pmetric // import "go.opentelemetry.io/collector/pdata/pmetric" 5 | 6 | import ( 7 | "testing" 8 | ) 9 | 10 | func FuzzUnmarshalMetrics(f *testing.F) { 11 | f.Fuzz(func(_ *testing.T, data []byte) { 12 | u := &JSONUnmarshaler{} 13 | //nolint: errcheck 14 | _, _ = u.UnmarshalMetrics(data) 15 | }) 16 | } 17 | -------------------------------------------------------------------------------- /pdata/pmetric/number_data_point_value_type_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package pmetric // import "go.opentelemetry.io/collector/pdata/pmetric" 5 | 6 | import ( 7 | "testing" 8 | 9 | "github.com/stretchr/testify/assert" 10 | ) 11 | 12 | func TestNumberDataPointValueTypeString(t *testing.T) { 13 | assert.Equal(t, "Empty", NumberDataPointValueTypeEmpty.String()) 14 | assert.Equal(t, "Int", NumberDataPointValueTypeInt.String()) 15 | assert.Equal(t, "Double", NumberDataPointValueTypeDouble.String()) 16 | assert.Equal(t, "", (NumberDataPointValueTypeDouble + 1).String()) 17 | } 18 | -------------------------------------------------------------------------------- /pdata/pmetric/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package pmetric 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /pdata/pmetric/pmetricotlp/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package pmetricotlp 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /pdata/pprofile/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /pdata/ptrace/fuzz_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package ptrace // import "go.opentelemetry.io/collector/pdata/ptrace" 5 | 6 | import ( 7 | "testing" 8 | ) 9 | 10 | func FuzzUnmarshalTraces(f *testing.F) { 11 | f.Fuzz(func(_ *testing.T, data []byte) { 12 | u := &JSONUnmarshaler{} 13 | //nolint: errcheck 14 | _, _ = u.UnmarshalTraces(data) 15 | }) 16 | } 17 | -------------------------------------------------------------------------------- /pdata/ptrace/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package ptrace 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /pdata/ptrace/ptraceotlp/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package ptraceotlp 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /pdata/ptrace/status_code_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package ptrace // import "go.opentelemetry.io/collector/pdata/ptrace" 5 | 6 | import ( 7 | "testing" 8 | 9 | "github.com/stretchr/testify/assert" 10 | ) 11 | 12 | func TestStatusCodeString(t *testing.T) { 13 | assert.EqualValues(t, "Unset", StatusCodeUnset.String()) 14 | assert.EqualValues(t, "Ok", StatusCodeOk.String()) 15 | assert.EqualValues(t, "Error", StatusCodeError.String()) 16 | assert.EqualValues(t, "", StatusCode(100).String()) 17 | } 18 | -------------------------------------------------------------------------------- /pdata/testdata/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /pdata/testdata/resource.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package testdata 5 | 6 | import "go.opentelemetry.io/collector/pdata/pcommon" 7 | 8 | func initResource(r pcommon.Resource) { 9 | r.Attributes().PutStr("resource-attr", "resource-attr-val-1") 10 | } 11 | -------------------------------------------------------------------------------- /processor/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.Common 2 | -------------------------------------------------------------------------------- /processor/batchprocessor/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /processor/batchprocessor/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package batchprocessor 4 | 5 | import ( 6 | "testing" 7 | 8 | "go.uber.org/goleak" 9 | ) 10 | 11 | func TestMain(m *testing.M) { 12 | goleak.VerifyTestMain(m) 13 | } 14 | -------------------------------------------------------------------------------- /processor/batchprocessor/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package metadata 4 | 5 | import ( 6 | "go.opentelemetry.io/collector/component" 7 | ) 8 | 9 | var ( 10 | Type = component.MustNewType("batch") 11 | ) 12 | 13 | const ( 14 | TracesStability = component.StabilityLevelBeta 15 | MetricsStability = component.StabilityLevelBeta 16 | LogsStability = component.StabilityLevelBeta 17 | ) 18 | -------------------------------------------------------------------------------- /processor/batchprocessor/testdata/config.yaml: -------------------------------------------------------------------------------- 1 | timeout: 10s 2 | send_batch_size: 10000 3 | send_batch_max_size: 11000 4 | -------------------------------------------------------------------------------- /processor/internal/logs.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package internal // import "go.opentelemetry.io/collector/processor/internal" 5 | 6 | import ( 7 | "go.opentelemetry.io/collector/component" 8 | "go.opentelemetry.io/collector/consumer" 9 | ) 10 | 11 | // Logs is a processor that can consume logs. 12 | type Logs interface { 13 | component.Component 14 | consumer.Logs 15 | } 16 | -------------------------------------------------------------------------------- /processor/internal/metrics.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package internal // import "go.opentelemetry.io/collector/processor/internal" 5 | 6 | import ( 7 | "go.opentelemetry.io/collector/component" 8 | "go.opentelemetry.io/collector/consumer" 9 | ) 10 | 11 | // Metrics is a processor that can consume metrics. 12 | type Metrics interface { 13 | component.Component 14 | consumer.Metrics 15 | } 16 | -------------------------------------------------------------------------------- /processor/internal/processor.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package internal // import "go.opentelemetry.io/collector/processor/internal" 5 | 6 | import "go.opentelemetry.io/collector/component" 7 | 8 | // Settings is passed to Create* functions in Factory. 9 | type Settings struct { 10 | // ID returns the ID of the component that will be created. 11 | ID component.ID 12 | 13 | component.TelemetrySettings 14 | 15 | // BuildInfo can be used by components for informational purposes 16 | BuildInfo component.BuildInfo 17 | } 18 | -------------------------------------------------------------------------------- /processor/internal/traces.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package internal // import "go.opentelemetry.io/collector/processor/internal" 5 | 6 | import ( 7 | "go.opentelemetry.io/collector/component" 8 | "go.opentelemetry.io/collector/consumer" 9 | ) 10 | 11 | // Traces is a processor that can consume traces. 12 | type Traces interface { 13 | component.Component 14 | consumer.Traces 15 | } 16 | -------------------------------------------------------------------------------- /processor/memorylimiterprocessor/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /processor/memorylimiterprocessor/config.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package memorylimiterprocessor // import "go.opentelemetry.io/collector/processor/memorylimiterprocessor" 5 | import "go.opentelemetry.io/collector/internal/memorylimiter" 6 | 7 | type Config = memorylimiter.Config 8 | -------------------------------------------------------------------------------- /processor/memorylimiterprocessor/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package memorylimiterprocessor 4 | 5 | import ( 6 | "testing" 7 | 8 | "go.uber.org/goleak" 9 | ) 10 | 11 | func TestMain(m *testing.M) { 12 | goleak.VerifyTestMain(m) 13 | } 14 | -------------------------------------------------------------------------------- /processor/memorylimiterprocessor/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package metadata 4 | 5 | import ( 6 | "go.opentelemetry.io/collector/component" 7 | ) 8 | 9 | var ( 10 | Type = component.MustNewType("memory_limiter") 11 | ) 12 | 13 | const ( 14 | TracesStability = component.StabilityLevelBeta 15 | MetricsStability = component.StabilityLevelBeta 16 | LogsStability = component.StabilityLevelBeta 17 | ) 18 | -------------------------------------------------------------------------------- /processor/memorylimiterprocessor/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: memory_limiter 2 | 3 | status: 4 | class: processor 5 | stability: 6 | beta: [traces, metrics, logs] 7 | distributions: [core, contrib, k8s] 8 | 9 | tests: 10 | config: 11 | check_interval: 5s 12 | limit_mib: 400 13 | spike_limit_mib: 50 14 | # TODO: https://github.com/open-telemetry/opentelemetry-collector/issues/9687 15 | skip_shutdown: true 16 | -------------------------------------------------------------------------------- /processor/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package processor 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /processor/processorhelper/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package processorhelper 4 | 5 | import ( 6 | "testing" 7 | 8 | "go.uber.org/goleak" 9 | ) 10 | 11 | func TestMain(m *testing.M) { 12 | goleak.VerifyTestMain(m) 13 | } 14 | -------------------------------------------------------------------------------- /processor/processortest/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package processortest 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /receiver/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.Common 2 | -------------------------------------------------------------------------------- /receiver/internal/logs.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package internal // import "go.opentelemetry.io/collector/receiver/internal" 5 | 6 | import "go.opentelemetry.io/collector/component" 7 | 8 | // Logs receiver receives logs. 9 | // Its purpose is to translate data from any format to the collector's internal logs data format. 10 | // LogsReceiver feeds a consumer.Logs with data. 11 | // 12 | // For example, it could be a receiver that reads syslogs and convert them into plog.Logs. 13 | type Logs interface { 14 | component.Component 15 | } 16 | -------------------------------------------------------------------------------- /receiver/internal/metrics.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package internal // import "go.opentelemetry.io/collector/receiver/internal" 5 | 6 | import "go.opentelemetry.io/collector/component" 7 | 8 | // Metrics receiver receives metrics. 9 | // Its purpose is to translate data from any format to the collector's internal metrics format. 10 | // MetricsReceiver feeds a consumer.Metrics with data. 11 | // 12 | // For example, it could be Prometheus data source which translates Prometheus metrics into pmetric.Metrics. 13 | type Metrics interface { 14 | component.Component 15 | } 16 | -------------------------------------------------------------------------------- /receiver/internal/receiver.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package internal // import "go.opentelemetry.io/collector/receiver/internal" 5 | 6 | import "go.opentelemetry.io/collector/component" 7 | 8 | // Settings configures Receiver creators. 9 | type Settings struct { 10 | // ID returns the ID of the component that will be created. 11 | ID component.ID 12 | 13 | component.TelemetrySettings 14 | 15 | // BuildInfo can be used by components for informational purposes. 16 | BuildInfo component.BuildInfo 17 | } 18 | -------------------------------------------------------------------------------- /receiver/internal/traces.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package internal // import "go.opentelemetry.io/collector/receiver/internal" 5 | 6 | import "go.opentelemetry.io/collector/component" 7 | 8 | // Traces receiver receives traces. 9 | // Its purpose is to translate data from any format to the collector's internal trace format. 10 | // TracesReceiver feeds a consumer.Traces with data. 11 | // 12 | // For example, it could be Zipkin data source which translates Zipkin spans into ptrace.Traces. 13 | type Traces interface { 14 | component.Component 15 | } 16 | -------------------------------------------------------------------------------- /receiver/nopreceiver/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /receiver/nopreceiver/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | //go:generate mdatagen metadata.yaml 5 | 6 | // Package nopreceiver serves as a placeholder receiver. 7 | package nopreceiver // import "go.opentelemetry.io/collector/receiver/nopreceiver" 8 | -------------------------------------------------------------------------------- /receiver/nopreceiver/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package nopreceiver 4 | 5 | import ( 6 | "testing" 7 | 8 | "go.uber.org/goleak" 9 | ) 10 | 11 | func TestMain(m *testing.M) { 12 | goleak.VerifyTestMain(m) 13 | } 14 | -------------------------------------------------------------------------------- /receiver/nopreceiver/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package metadata 4 | 5 | import ( 6 | "go.opentelemetry.io/collector/component" 7 | ) 8 | 9 | var ( 10 | Type = component.MustNewType("nop") 11 | ) 12 | 13 | const ( 14 | TracesStability = component.StabilityLevelBeta 15 | MetricsStability = component.StabilityLevelBeta 16 | LogsStability = component.StabilityLevelBeta 17 | ) 18 | -------------------------------------------------------------------------------- /receiver/nopreceiver/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: nop 2 | 3 | status: 4 | class: receiver 5 | stability: 6 | beta: [traces, metrics, logs] 7 | distributions: [core, contrib] 8 | -------------------------------------------------------------------------------- /receiver/otlpreceiver/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.Common 2 | -------------------------------------------------------------------------------- /receiver/otlpreceiver/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | //go:generate mdatagen metadata.yaml 5 | 6 | // Package otlpreceiver receives data in OTLP format. 7 | package otlpreceiver // import "go.opentelemetry.io/collector/receiver/otlpreceiver" 8 | -------------------------------------------------------------------------------- /receiver/otlpreceiver/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package otlpreceiver 4 | 5 | import ( 6 | "testing" 7 | 8 | "go.uber.org/goleak" 9 | ) 10 | 11 | func TestMain(m *testing.M) { 12 | goleak.VerifyTestMain(m) 13 | } 14 | -------------------------------------------------------------------------------- /receiver/otlpreceiver/internal/logs/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package logs 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /receiver/otlpreceiver/internal/metadata/generated_status.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package metadata 4 | 5 | import ( 6 | "go.opentelemetry.io/collector/component" 7 | ) 8 | 9 | var ( 10 | Type = component.MustNewType("otlp") 11 | ) 12 | 13 | const ( 14 | LogsStability = component.StabilityLevelBeta 15 | TracesStability = component.StabilityLevelStable 16 | MetricsStability = component.StabilityLevelStable 17 | ) 18 | -------------------------------------------------------------------------------- /receiver/otlpreceiver/internal/metrics/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package metrics 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /receiver/otlpreceiver/internal/trace/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package trace 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /receiver/otlpreceiver/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: otlp 2 | 3 | status: 4 | class: receiver 5 | stability: 6 | stable: [traces, metrics] 7 | beta: [logs] 8 | distributions: [core, contrib, k8s] 9 | -------------------------------------------------------------------------------- /receiver/otlpreceiver/testdata/bad_no_proto_config.yaml: -------------------------------------------------------------------------------- 1 | protocols: 2 | -------------------------------------------------------------------------------- /receiver/otlpreceiver/testdata/bad_proto_config.yaml: -------------------------------------------------------------------------------- 1 | protocols: 2 | thrift: 3 | endpoint: "127.0.0.1:1234" 4 | -------------------------------------------------------------------------------- /receiver/otlpreceiver/testdata/default.yaml: -------------------------------------------------------------------------------- 1 | # The following entry initializes the default OTLP receiver. 2 | # The full name of this receiver is `otlp` and can be referenced in pipelines by 'otlp'. 3 | protocols: 4 | grpc: 5 | http: 6 | -------------------------------------------------------------------------------- /receiver/otlpreceiver/testdata/invalid_logs_path.yaml: -------------------------------------------------------------------------------- 1 | protocols: 2 | http: 3 | logs_url_path: ":invalid" 4 | -------------------------------------------------------------------------------- /receiver/otlpreceiver/testdata/invalid_metrics_path.yaml: -------------------------------------------------------------------------------- 1 | protocols: 2 | http: 3 | metrics_url_path: ":invalid" 4 | -------------------------------------------------------------------------------- /receiver/otlpreceiver/testdata/invalid_traces_path.yaml: -------------------------------------------------------------------------------- 1 | protocols: 2 | http: 3 | traces_url_path: ":invalid" 4 | -------------------------------------------------------------------------------- /receiver/otlpreceiver/testdata/only_grpc.yaml: -------------------------------------------------------------------------------- 1 | # The following entry initializes the default OTLP receiver with only gRPC support. 2 | protocols: 3 | grpc: 4 | -------------------------------------------------------------------------------- /receiver/otlpreceiver/testdata/only_http.yaml: -------------------------------------------------------------------------------- 1 | # The following entry initializes the default OTLP receiver with only http support. 2 | protocols: 3 | http: 4 | -------------------------------------------------------------------------------- /receiver/otlpreceiver/testdata/only_http_empty_map.yaml: -------------------------------------------------------------------------------- 1 | # The following entry initializes the default OTLP receiver with only http support by setting it explicitly to an empty map. 2 | protocols: 3 | http: {} 4 | -------------------------------------------------------------------------------- /receiver/otlpreceiver/testdata/only_http_null.yaml: -------------------------------------------------------------------------------- 1 | # The following entry initializes the default OTLP receiver with only http support by setting it explicitly to null. 2 | protocols: 3 | http: null 4 | -------------------------------------------------------------------------------- /receiver/otlpreceiver/testdata/typo_default_proto_config.yaml: -------------------------------------------------------------------------------- 1 | protocols: 2 | grpc: 3 | htttp: 4 | -------------------------------------------------------------------------------- /receiver/otlpreceiver/testdata/uds.yaml: -------------------------------------------------------------------------------- 1 | # The following entry demonstrates how to specify a Unix Domain Socket for the server. 2 | protocols: 3 | grpc: 4 | transport: unix 5 | endpoint: /tmp/grpc_otlp.sock 6 | http: 7 | # transport: unix 8 | endpoint: /tmp/http_otlp.sock 9 | -------------------------------------------------------------------------------- /receiver/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package receiver 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /receiver/receiverhelper/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package receiverhelper 4 | 5 | import ( 6 | "testing" 7 | 8 | "go.uber.org/goleak" 9 | ) 10 | 11 | func TestMain(m *testing.M) { 12 | goleak.VerifyTestMain(m) 13 | } 14 | -------------------------------------------------------------------------------- /receiver/receivertest/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package receivertest 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /receiver/scrapererror/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Package scrapererror provides custom error types for scrapers. 5 | package scrapererror // import "go.opentelemetry.io/collector/receiver/scrapererror" 6 | -------------------------------------------------------------------------------- /receiver/scrapererror/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package scrapererror 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /receiver/scraperhelper/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | //go:generate mdatagen metadata.yaml 5 | 6 | // Package scraperhelper provides utilities for scrapers. 7 | package scraperhelper // import "go.opentelemetry.io/collector/receiver/scraperhelper" 8 | -------------------------------------------------------------------------------- /receiver/scraperhelper/documentation.md: -------------------------------------------------------------------------------- 1 | [comment]: <> (Code generated by mdatagen. DO NOT EDIT.) 2 | 3 | # scraperhelper 4 | 5 | ## Internal Telemetry 6 | 7 | The following telemetry is emitted by this component. 8 | 9 | ### otelcol_scraper_errored_metric_points 10 | 11 | Number of metric points that were unable to be scraped. 12 | 13 | | Unit | Metric Type | Value Type | Monotonic | 14 | | ---- | ----------- | ---------- | --------- | 15 | | {datapoints} | Sum | Int | true | 16 | 17 | ### otelcol_scraper_scraped_metric_points 18 | 19 | Number of metric points successfully scraped. 20 | 21 | | Unit | Metric Type | Value Type | Monotonic | 22 | | ---- | ----------- | ---------- | --------- | 23 | | {datapoints} | Sum | Int | true | 24 | -------------------------------------------------------------------------------- /receiver/scraperhelper/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package scraperhelper 4 | 5 | import ( 6 | "testing" 7 | 8 | "go.uber.org/goleak" 9 | ) 10 | 11 | func TestMain(m *testing.M) { 12 | goleak.VerifyTestMain(m) 13 | } 14 | -------------------------------------------------------------------------------- /receiver/scraperhelper/metadata.yaml: -------------------------------------------------------------------------------- 1 | type: scraperhelper 2 | 3 | status: 4 | class: receiver 5 | not_component: true 6 | stability: 7 | beta: [traces, metrics, logs] 8 | distributions: [core, contrib] 9 | 10 | telemetry: 11 | metrics: 12 | scraper_scraped_metric_points: 13 | enabled: true 14 | description: Number of metric points successfully scraped. 15 | unit: "{datapoints}" 16 | sum: 17 | value_type: int 18 | monotonic: true 19 | 20 | scraper_errored_metric_points: 21 | enabled: true 22 | description: Number of metric points that were unable to be scraped. 23 | unit: "{datapoints}" 24 | sum: 25 | value_type: int 26 | monotonic: true -------------------------------------------------------------------------------- /semconv/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.Common 2 | -------------------------------------------------------------------------------- /semconv/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /semconv/v1.10.0/nonstandard.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.10.0" 5 | 6 | const ( 7 | OtelLibraryName = "otel.library.name" 8 | OtelLibraryVersion = "otel.library.version" 9 | OtelStatusCode = "otel.status_code" 10 | OtelStatusDescription = "otel.status_description" 11 | ) 12 | -------------------------------------------------------------------------------- /semconv/v1.10.0/schema.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.10.0" 5 | 6 | // SchemaURL is the schema URL that matches the version of the semantic conventions 7 | // that this package defines. Conventions packages starting from v1.4.0 must declare 8 | // non-empty schema URL in the form https://opentelemetry.io/schemas/ 9 | const SchemaURL = "https://opentelemetry.io/schemas/1.10.0" 10 | -------------------------------------------------------------------------------- /semconv/v1.11.0/nonstandard.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.11.0" 5 | 6 | const ( 7 | OtelLibraryName = "otel.library.name" 8 | OtelLibraryVersion = "otel.library.version" 9 | OtelStatusCode = "otel.status_code" 10 | OtelStatusDescription = "otel.status_description" 11 | ) 12 | -------------------------------------------------------------------------------- /semconv/v1.11.0/schema.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.11.0" 5 | 6 | // SchemaURL is the schema URL that matches the version of the semantic conventions 7 | // that this package defines. Conventions packages starting from v1.4.0 must declare 8 | // non-empty schema URL in the form https://opentelemetry.io/schemas/ 9 | const SchemaURL = "https://opentelemetry.io/schemas/1.11.0" 10 | -------------------------------------------------------------------------------- /semconv/v1.12.0/nonstandard.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.12.0" 5 | 6 | const ( 7 | OtelLibraryName = "otel.library.name" 8 | OtelLibraryVersion = "otel.library.version" 9 | OtelStatusCode = "otel.status_code" 10 | OtelStatusDescription = "otel.status_description" 11 | ) 12 | -------------------------------------------------------------------------------- /semconv/v1.12.0/schema.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.12.0" 5 | 6 | // SchemaURL is the schema URL that matches the version of the semantic conventions 7 | // that this package defines. Conventions packages starting from v1.4.0 must declare 8 | // non-empty schema URL in the form https://opentelemetry.io/schemas/ 9 | const SchemaURL = "https://opentelemetry.io/schemas/1.12.0" 10 | -------------------------------------------------------------------------------- /semconv/v1.13.0/nonstandard.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.13.0" 5 | 6 | const ( 7 | OtelLibraryName = "otel.library.name" 8 | OtelLibraryVersion = "otel.library.version" 9 | OtelStatusCode = "otel.status_code" 10 | OtelStatusDescription = "otel.status_description" 11 | ) 12 | -------------------------------------------------------------------------------- /semconv/v1.13.0/schema.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.13.0" 5 | 6 | // SchemaURL is the schema URL that matches the version of the semantic conventions 7 | // that this package defines. Conventions packages starting from v1.4.0 must declare 8 | // non-empty schema URL in the form https://opentelemetry.io/schemas/ 9 | const SchemaURL = "https://opentelemetry.io/schemas/1.13.0" 10 | -------------------------------------------------------------------------------- /semconv/v1.16.0/nonstandard.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.16.0" 5 | 6 | const ( 7 | OtelLibraryName = "otel.library.name" 8 | OtelLibraryVersion = "otel.library.version" 9 | OtelStatusCode = "otel.status_code" 10 | OtelStatusDescription = "otel.status_description" 11 | ) 12 | -------------------------------------------------------------------------------- /semconv/v1.16.0/schema.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.16.0" 5 | 6 | // SchemaURL is the schema URL that matches the version of the semantic conventions 7 | // that this package defines. Conventions packages starting from v1.4.0 must declare 8 | // non-empty schema URL in the form https://opentelemetry.io/schemas/ 9 | const SchemaURL = "https://opentelemetry.io/schemas/1.16.0" 10 | -------------------------------------------------------------------------------- /semconv/v1.17.0/schema.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.17.0" 5 | 6 | // SchemaURL is the schema URL that matches the version of the semantic conventions 7 | // that this package defines. Conventions packages starting from v1.4.0 must declare 8 | // non-empty schema URL in the form https://opentelemetry.io/schemas/ 9 | const SchemaURL = "https://opentelemetry.io/schemas/1.17.0" 10 | -------------------------------------------------------------------------------- /semconv/v1.18.0/schema.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.18.0" 5 | 6 | // SchemaURL is the schema URL that matches the version of the semantic conventions 7 | // that this package defines. Conventions packages starting from v1.4.0 must declare 8 | // non-empty schema URL in the form https://opentelemetry.io/schemas/ 9 | const SchemaURL = "https://opentelemetry.io/schemas/1.18.0" 10 | -------------------------------------------------------------------------------- /semconv/v1.21.0/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Package semconv implements OpenTelemetry semantic conventions. 5 | // 6 | // OpenTelemetry semantic conventions are agreed standardized naming 7 | // patterns for OpenTelemetry things. This package represents the v1.21.0 8 | // version of the OpenTelemetry semantic conventions. 9 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.21.0" 10 | -------------------------------------------------------------------------------- /semconv/v1.21.0/schema.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.21.0" 5 | 6 | // SchemaURL is the schema URL that matches the version of the semantic conventions 7 | // that this package defines. Semconv packages starting from v1.4.0 must declare 8 | // non-empty schema URL in the form https://opentelemetry.io/schemas/ 9 | const SchemaURL = "https://opentelemetry.io/schemas/1.21.0" 10 | -------------------------------------------------------------------------------- /semconv/v1.22.0/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Package semconv implements OpenTelemetry semantic conventions. 5 | // 6 | // OpenTelemetry semantic conventions are agreed standardized naming 7 | // patterns for OpenTelemetry things. This package represents the v1.22.0 8 | // version of the OpenTelemetry semantic conventions. 9 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.22.0" 10 | -------------------------------------------------------------------------------- /semconv/v1.22.0/schema.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.22.0" 5 | 6 | // SchemaURL is the schema URL that matches the version of the semantic conventions 7 | // that this package defines. Semconv packages starting from v1.4.0 must declare 8 | // non-empty schema URL in the form https://opentelemetry.io/schemas/ 9 | const SchemaURL = "https://opentelemetry.io/schemas/1.22.0" 10 | -------------------------------------------------------------------------------- /semconv/v1.25.0/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | // Package semconv implements OpenTelemetry semantic conventions. 5 | // 6 | // OpenTelemetry semantic conventions are agreed standardized naming 7 | // patterns for OpenTelemetry things. This package represents the v1.25.0 8 | // version of the OpenTelemetry semantic conventions. 9 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.25.0" 10 | -------------------------------------------------------------------------------- /semconv/v1.25.0/schema.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.25.0" 5 | 6 | // SchemaURL is the schema URL that matches the version of the semantic conventions 7 | // that this package defines. Semconv packages starting from v1.4.0 must declare 8 | // non-empty schema URL in the form https://opentelemetry.io/schemas/ 9 | const SchemaURL = "https://opentelemetry.io/schemas/1.25.0" 10 | -------------------------------------------------------------------------------- /semconv/v1.5.0/nonstandard.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.5.0" 5 | 6 | const ( 7 | InstrumentationLibraryName = "otel.library.name" 8 | InstrumentationLibraryVersion = "otel.library.version" 9 | ) 10 | 11 | const ( 12 | OtelStatusCode = "otel.status_code" 13 | OtelStatusDescription = "otel.status_description" 14 | ) 15 | -------------------------------------------------------------------------------- /semconv/v1.5.0/schema.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.5.0" 5 | 6 | // SchemaURL is the schema URL that matches the version of the semantic conventions 7 | // that this package defines. Conventions packages starting from v1.4.0 must declare 8 | // non-empty schema URL in the form https://opentelemetry.io/schemas/ 9 | const SchemaURL = "https://opentelemetry.io/schemas/1.5.0" 10 | -------------------------------------------------------------------------------- /semconv/v1.6.1/nonstandard.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.6.1" 5 | 6 | const ( 7 | OtelLibraryName = "otel.library.name" 8 | OtelLibraryVersion = "otel.library.version" 9 | OtelStatusCode = "otel.status_code" 10 | OtelStatusDescription = "otel.status_description" 11 | ) 12 | -------------------------------------------------------------------------------- /semconv/v1.6.1/schema.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.6.1" 5 | 6 | // SchemaURL is the schema URL that matches the version of the semantic conventions 7 | // that this package defines. Conventions packages starting from v1.4.0 must declare 8 | // non-empty schema URL in the form https://opentelemetry.io/schemas/ 9 | const SchemaURL = "https://opentelemetry.io/schemas/1.6.1" 10 | -------------------------------------------------------------------------------- /semconv/v1.7.0/nonstandard.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.7.0" 5 | 6 | const ( 7 | OtelLibraryName = "otel.library.name" 8 | OtelLibraryVersion = "otel.library.version" 9 | OtelStatusCode = "otel.status_code" 10 | OtelStatusDescription = "otel.status_description" 11 | ) 12 | -------------------------------------------------------------------------------- /semconv/v1.7.0/schema.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.7.0" 5 | 6 | // SchemaURL is the schema URL that matches the version of the semantic conventions 7 | // that this package defines. Conventions packages starting from v1.4.0 must declare 8 | // non-empty schema URL in the form https://opentelemetry.io/schemas/ 9 | const SchemaURL = "https://opentelemetry.io/schemas/1.7.0" 10 | -------------------------------------------------------------------------------- /semconv/v1.8.0/nonstandard.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.8.0" 5 | 6 | const ( 7 | OtelLibraryName = "otel.library.name" 8 | OtelLibraryVersion = "otel.library.version" 9 | OtelStatusCode = "otel.status_code" 10 | OtelStatusDescription = "otel.status_description" 11 | ) 12 | -------------------------------------------------------------------------------- /semconv/v1.8.0/schema.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.8.0" 5 | 6 | // SchemaURL is the schema URL that matches the version of the semantic conventions 7 | // that this package defines. Conventions packages starting from v1.4.0 must declare 8 | // non-empty schema URL in the form https://opentelemetry.io/schemas/ 9 | const SchemaURL = "https://opentelemetry.io/schemas/1.8.0" 10 | -------------------------------------------------------------------------------- /semconv/v1.9.0/nonstandard.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.9.0" 5 | 6 | const ( 7 | OtelLibraryName = "otel.library.name" 8 | OtelLibraryVersion = "otel.library.version" 9 | OtelStatusCode = "otel.status_code" 10 | OtelStatusDescription = "otel.status_description" 11 | ) 12 | -------------------------------------------------------------------------------- /semconv/v1.9.0/schema.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package semconv // import "go.opentelemetry.io/collector/semconv/v1.9.0" 5 | 6 | // SchemaURL is the schema URL that matches the version of the semantic conventions 7 | // that this package defines. Conventions packages starting from v1.4.0 must declare 8 | // non-empty schema URL in the form https://opentelemetry.io/schemas/ 9 | const SchemaURL = "https://opentelemetry.io/schemas/1.9.0" 10 | -------------------------------------------------------------------------------- /service/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.Common 2 | -------------------------------------------------------------------------------- /service/extensions/config.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package extensions // import "go.opentelemetry.io/collector/service/extensions" 5 | 6 | import "go.opentelemetry.io/collector/component" 7 | 8 | // Config represents the ordered list of extensions configured for the service. 9 | type Config []component.ID 10 | -------------------------------------------------------------------------------- /service/extensions/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package extensions 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /service/generated_package_test.go: -------------------------------------------------------------------------------- 1 | // Code generated by mdatagen. DO NOT EDIT. 2 | 3 | package service 4 | 5 | import ( 6 | "testing" 7 | 8 | "go.uber.org/goleak" 9 | ) 10 | 11 | func TestMain(m *testing.M) { 12 | goleak.VerifyTestMain(m, goleak.IgnoreTopFunction("go.opencensus.io/stats/view.(*worker).start"), goleak.IgnoreTopFunction("go.opentelemetry.io/collector/service/internal/proctelemetry.InitPrometheusServer.func1")) 13 | } 14 | -------------------------------------------------------------------------------- /service/internal/capabilityconsumer/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package capabilityconsumer 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /service/internal/components/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package components 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /service/internal/graph/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package graph 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /service/internal/servicetelemetry/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package servicetelemetry 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /service/internal/status/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package status 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /service/internal/status/statustest/statustest.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package statustest // import "go.opentelemetry.io/collector/service/internal/status/statustest" 5 | 6 | import ( 7 | "go.opentelemetry.io/collector/component" 8 | "go.opentelemetry.io/collector/service/internal/status" 9 | ) 10 | 11 | func NewNopStatusReporter() status.Reporter { 12 | return &nopStatusReporter{} 13 | } 14 | 15 | type nopStatusReporter struct{} 16 | 17 | func (r *nopStatusReporter) Ready() {} 18 | 19 | func (r *nopStatusReporter) ReportStatus(*component.InstanceID, *component.StatusEvent) {} 20 | 21 | func (r *nopStatusReporter) ReportOKIfStarting(*component.InstanceID) {} 22 | -------------------------------------------------------------------------------- /service/internal/status/statustest/statustest_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package statustest // import "go.opentelemetry.io/collector/service/internal/status/statustest" 5 | 6 | import "testing" 7 | 8 | func TestNopStatusReporter(*testing.T) { 9 | nop := NewNopStatusReporter() 10 | nop.Ready() 11 | nop.ReportOKIfStarting(nil) 12 | nop.ReportStatus(nil, nil) 13 | } 14 | -------------------------------------------------------------------------------- /service/internal/testcomponents/example_connector_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package testcomponents 5 | 6 | import ( 7 | "context" 8 | "testing" 9 | 10 | "github.com/stretchr/testify/assert" 11 | 12 | "go.opentelemetry.io/collector/component/componenttest" 13 | ) 14 | 15 | func TestExampleConnector(t *testing.T) { 16 | conn := &ExampleConnector{} 17 | host := componenttest.NewNopHost() 18 | assert.False(t, conn.Started()) 19 | assert.NoError(t, conn.Start(context.Background(), host)) 20 | assert.True(t, conn.Started()) 21 | 22 | assert.False(t, conn.Stopped()) 23 | assert.NoError(t, conn.Shutdown(context.Background())) 24 | assert.True(t, conn.Stopped()) 25 | } 26 | -------------------------------------------------------------------------------- /service/internal/testcomponents/example_processor_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package testcomponents 5 | 6 | import ( 7 | "context" 8 | "testing" 9 | 10 | "github.com/stretchr/testify/assert" 11 | 12 | "go.opentelemetry.io/collector/component/componenttest" 13 | ) 14 | 15 | func TestExampleProcessor(t *testing.T) { 16 | prc := &ExampleProcessor{} 17 | host := componenttest.NewNopHost() 18 | assert.False(t, prc.Started()) 19 | assert.NoError(t, prc.Start(context.Background(), host)) 20 | assert.True(t, prc.Started()) 21 | 22 | assert.False(t, prc.Stopped()) 23 | assert.NoError(t, prc.Shutdown(context.Background())) 24 | assert.True(t, prc.Stopped()) 25 | } 26 | -------------------------------------------------------------------------------- /service/internal/testcomponents/example_receiver_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package testcomponents 5 | 6 | import ( 7 | "context" 8 | "testing" 9 | 10 | "github.com/stretchr/testify/assert" 11 | 12 | "go.opentelemetry.io/collector/component/componenttest" 13 | ) 14 | 15 | func TestExampleReceiver(t *testing.T) { 16 | rcv := &ExampleReceiver{} 17 | host := componenttest.NewNopHost() 18 | assert.False(t, rcv.Started()) 19 | assert.NoError(t, rcv.Start(context.Background(), host)) 20 | assert.True(t, rcv.Started()) 21 | 22 | assert.False(t, rcv.Stopped()) 23 | assert.NoError(t, rcv.Shutdown(context.Background())) 24 | assert.True(t, rcv.Stopped()) 25 | } 26 | -------------------------------------------------------------------------------- /service/internal/testcomponents/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package testcomponents 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /service/internal/zpages/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package zpages 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /service/internal/zpages/templates/component_header.html: -------------------------------------------------------------------------------- 1 | {{$link := .Link}} 2 | {{- if $link -}} 3 |
{{.Name}}
4 | {{- else -}} 5 |
{{.Name}}
6 | {{- end -}} -------------------------------------------------------------------------------- /service/internal/zpages/templates/extensions_table.html: -------------------------------------------------------------------------------- 1 | 2 | {{range $rowindex, $row := .Rows}} 3 | {{- if even $rowindex}} 4 | 5 | {{else}} 6 | {{end -}} 7 | 8 | 9 | {{end}} 10 |
{{.FullName}}
-------------------------------------------------------------------------------- /service/internal/zpages/templates/page_footer.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /service/internal/zpages/templates/page_header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{.Title}} 5 | 6 | 7 | 8 | 9 | 10 | 11 |

{{.Title}}

-------------------------------------------------------------------------------- /service/internal/zpages/templates/properties_table.html: -------------------------------------------------------------------------------- 1 | {{.Name}}: 2 | 3 | {{ $index := 0 }} 4 | {{range $index, $element := .Properties}} 5 | {{- if even $index}} 6 | 7 | {{else}} 8 | {{end -}} 9 | 10 | 11 | 12 | 13 | {{end}} 14 |
{{$element|getKey}}  |  {{$element|getValue}}
-------------------------------------------------------------------------------- /service/pipelines/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package pipelines 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /service/telemetry/package_test.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package telemetry 5 | 6 | import ( 7 | "testing" 8 | 9 | "go.uber.org/goleak" 10 | ) 11 | 12 | func TestMain(m *testing.M) { 13 | goleak.VerifyTestMain(m) 14 | } 15 | -------------------------------------------------------------------------------- /service/telemetry/telemetry.go: -------------------------------------------------------------------------------- 1 | // Copyright The OpenTelemetry Authors 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package telemetry // import "go.opentelemetry.io/collector/service/telemetry" 5 | 6 | import ( 7 | "go.opentelemetry.io/collector/service/telemetry/internal" 8 | ) 9 | 10 | // Settings holds configuration for building Telemetry. 11 | type Settings = internal.Settings 12 | --------------------------------------------------------------------------------