diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 46e336c5ecb..20cd30ea7ba 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -560,6 +560,7 @@ /packages/zeek @elastic/integration-experience /packages/zerofox @elastic/security-service-integrations /packages/zeronetworks @elastic/security-service-integrations +/packages/zipkin_input_otel @elastic/ecosystem /packages/zookeeper @elastic/obs-infraobs-integrations /packages/zoom @elastic/security-service-integrations /packages/zscaler_zia @elastic/security-service-integrations diff --git a/packages/zipkin_input_otel/LICENSE.txt b/packages/zipkin_input_otel/LICENSE.txt new file mode 100644 index 00000000000..d317b57b294 --- /dev/null +++ b/packages/zipkin_input_otel/LICENSE.txt @@ -0,0 +1,93 @@ +Elastic License 2.0 + +URL: https://www.elastic.co/licensing/elastic-license + +## Acceptance + +By using the software, you agree to all of the terms and conditions below. + +## Copyright License + +The licensor grants you a non-exclusive, royalty-free, worldwide, +non-sublicensable, non-transferable license to use, copy, distribute, make +available, and prepare derivative works of the software, in each case subject to +the limitations and conditions below. + +## Limitations + +You may not provide the software to third parties as a hosted or managed +service, where the service provides users with access to any substantial set of +the features or functionality of the software. + +You may not move, change, disable, or circumvent the license key functionality +in the software, and you may not remove or obscure any functionality in the +software that is protected by the license key. + +You may not alter, remove, or obscure any licensing, copyright, or other notices +of the licensor in the software. Any use of the licensor's trademarks is subject +to applicable law. + +## Patents + +The licensor grants you a license, under any patent claims the licensor can +license, or becomes able to license, to make, have made, use, sell, offer for +sale, import and have imported the software, in each case subject to the +limitations and conditions in this license. This license does not cover any +patent claims that you cause to be infringed by modifications or additions to +the software. If you or your company make any written claim that the software +infringes or contributes to infringement of any patent, your patent license for +the software granted under these terms ends immediately. If your company makes +such a claim, your patent license ends immediately for work on behalf of your +company. + +## Notices + +You must ensure that anyone who gets a copy of any part of the software from you +also gets a copy of these terms. + +If you modify the software, you must include in any modified copies of the +software prominent notices stating that you have modified the software. + +## No Other Rights + +These terms do not imply any licenses other than those expressly granted in +these terms. + +## Termination + +If you use the software in violation of these terms, such use is not licensed, +and your licenses will automatically terminate. If the licensor provides you +with a notice of your violation, and you cease all violation of this license no +later than 30 days after you receive that notice, your licenses will be +reinstated retroactively. However, if you violate these terms after such +reinstatement, any additional violation of these terms will cause your licenses +to terminate automatically and permanently. + +## No Liability + +*As far as the law allows, the software comes as is, without any warranty or +condition, and the licensor will not be liable to you for any damages arising +out of these terms or the use or nature of the software, under any kind of +legal claim.* + +## Definitions + +The **licensor** is the entity offering these terms, and the **software** is the +software the licensor makes available under these terms, including any portion +of it. + +**you** refers to the individual or entity agreeing to these terms. + +**your company** is any legal entity, sole proprietorship, or other kind of +organization that you work for, plus all organizations that have control over, +are under the control of, or are under common control with that +organization. **control** means ownership of substantially all the assets of an +entity, or the power to direct its management and policies by vote, contract, or +otherwise. Control can be direct or indirect. + +**your licenses** are all the licenses granted to you for the software under +these terms. + +**use** means anything you do with the software requiring one of your licenses. + +**trademark** means trademarks, service marks, and similar rights. diff --git a/packages/zipkin_input_otel/_dev/build/docs/README.md b/packages/zipkin_input_otel/_dev/build/docs/README.md new file mode 100644 index 00000000000..80968afe732 --- /dev/null +++ b/packages/zipkin_input_otel/_dev/build/docs/README.md @@ -0,0 +1,22 @@ +# Zipkin OpenTelemetry Input Package + +## Overview +The Zipkin OpenTelemetry Input Package for Elastic enables collection of trace data from applications instrumented with [Zipkin](https://zipkin.io/) through OpenTelemetry protocols using the [zipkinreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/zipkinreceiver#zipkin-receiver). + +### How it works +This package receives Zipkin trace data (V1 and V2 JSON/Protobuf formats) by configuring the Zipkin receiver in the Input Package, which then gets applied to the zipkinreceiver present in the EDOT collector, which then forwards the data to Elastic Agent. The Elastic Agent processes and enriches the data before sending it to Elasticsearch for indexing and analysis. + +## Configuration + +For the full list of settings exposed for the receiver and examples, refer to the [Zipkin Receiver documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/zipkinreceiver). + +## Troubleshooting + +If you encounter issues: + +1. Verify the endpoint is accessible and not blocked by a firewall. +2. Ensure applications are sending Zipkin-formatted traces to the configured endpoint (default: `http://:9411`). +3. Check the Elastic Agent logs for any receiver errors. + +## Traces reference +For more details about the Zipkin receiver and its configuration options, refer to the [Zipkin Receiver documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/zipkinreceiver) in the upstream OpenTelemetry Collector repository. diff --git a/packages/zipkin_input_otel/_dev/deploy/docker/docker-compose.yml b/packages/zipkin_input_otel/_dev/deploy/docker/docker-compose.yml new file mode 100644 index 00000000000..0cd0903caec --- /dev/null +++ b/packages/zipkin_input_otel/_dev/deploy/docker/docker-compose.yml @@ -0,0 +1,21 @@ +version: '2.3' +services: + run_queries: + image: curlimages/curl + environment: + - TARGET_URL=http://backend:9000 + volumes: + - ./scripts/run_queries.sh:/run_queries.sh + command: ["sh", "/run_queries.sh"] + depends_on: + backend: + condition: service_healthy + # Scenario based on the example defined in + # https://github.com/openzipkin/brave-example/tree/a71b18511b4fc8cbbe67ea2a6fd5ca43048c2465/docker + # https://github.com/openzipkin/brave-example/blob/a71b18511b4fc8cbbe67ea2a6fd5ca43048c2465/README.md#running-the-example + # The backend container is used to generate traces that are sent to the elastic-agent container. + backend: + image: ghcr.io/openzipkin/brave-example:armeria + entrypoint: start-backend + environment: + - ZIPKIN_BASEURL=http://elastic-agent:9411 diff --git a/packages/zipkin_input_otel/_dev/deploy/docker/scripts/run_queries.sh b/packages/zipkin_input_otel/_dev/deploy/docker/scripts/run_queries.sh new file mode 100755 index 00000000000..bd244f45425 --- /dev/null +++ b/packages/zipkin_input_otel/_dev/deploy/docker/scripts/run_queries.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env sh + +set -ex + +TARGET_URL=${TARGET_URL:-http://backend:9000} +SLEEP_TIME=${SLEEP_TIME:-5} + +# NOTE: backend container is the one that requires to communicate with the elastic-agent container +# to send the traces to the zipkin receiver port. If set the SIGHUP signal in the test system configuration +# file, that signal would be received by the backend container and it gets killed. +# Therefore, the SIGHUP signal is not used to start the workload and it is done here instead (separate container). + +# Wait for the elastic-agent container to be ready with the corresponding +# agent policy assigned +sleep ${SLEEP_TIME} + +echo "Sending traces to ${TARGET_URL}/api" +i=0 +while true; do + echo "Trigger query ${i}" + # Force creating traces containing requests with errors + # The following curl command will fail with a 404 error per the backend code. + curl -s -o /dev/null "${TARGET_URL}" + + ## Create traces without any errors + # curl ${TARGET_URL}/api will return a 200 status code + curl -s -o /dev/null "${TARGET_URL}/api" + i=$((i+1)) + sleep 1 +done diff --git a/packages/zipkin_input_otel/_dev/test/policy/test-default-custom-dataset.expected b/packages/zipkin_input_otel/_dev/test/policy/test-default-custom-dataset.expected new file mode 100644 index 00000000000..cddb652cb4a --- /dev/null +++ b/packages/zipkin_input_otel/_dev/test/policy/test-default-custom-dataset.expected @@ -0,0 +1,83 @@ +connectors: + elasticapm/componentid-0: {} + forward: {} +exporters: + elasticsearch/componentid-0: + endpoints: + - https://elasticsearch:9200 +inputs: [] +output_permissions: + default: + _elastic_agent_checks: + cluster: + - monitor + _elastic_agent_monitoring: + indices: [] + uuid-for-permissions-on-related-indices: + indices: + - names: + - traces-*-* + privileges: + - auto_configure + - create_doc + - names: + - logs-generic.otel-* + privileges: + - auto_configure + - create_doc + - names: + - metrics-*-* + privileges: + - auto_configure + - create_doc +processors: + elasticapm/componentid-0: {} + transform/componentid-0: + metric_statements: + - context: datapoint + statements: + - set(attributes["data_stream.namespace"], "ep") + transform/componentid-1: + trace_statements: + - context: span + statements: + - set(attributes["data_stream.type"], "traces") + - set(attributes["data_stream.dataset"], "zipkin.custom") + - set(attributes["data_stream.namespace"], "ep") + - context: spanevent + statements: + - set(attributes["data_stream.type"], "logs") + - set(attributes["data_stream.namespace"], "ep") +receivers: + zipkin/componentid-0: + endpoint: 0.0.0.0:9411 + parse_string_tags: true +secret_references: [] +service: + pipelines: + metrics: + exporters: + - elasticsearch/componentid-0 + receivers: + - forward + metrics/componentid-1: + exporters: + - forward + processors: + - transform/componentid-0 + receivers: + - elasticapm/componentid-0 + traces: + exporters: + - elasticsearch/componentid-0 + receivers: + - forward + traces/componentid-0: + exporters: + - elasticapm/componentid-0 + - forward + processors: + - elasticapm/componentid-0 + - transform/componentid-1 + receivers: + - zipkin/componentid-0 diff --git a/packages/zipkin_input_otel/_dev/test/policy/test-default-custom-dataset.yml b/packages/zipkin_input_otel/_dev/test/policy/test-default-custom-dataset.yml new file mode 100644 index 00000000000..90f01adbefc --- /dev/null +++ b/packages/zipkin_input_otel/_dev/test/policy/test-default-custom-dataset.yml @@ -0,0 +1,4 @@ +vars: + endpoint: "0.0.0.0:9411" + parse_string_tags: true + data_stream.dataset: "zipkin.custom" diff --git a/packages/zipkin_input_otel/_dev/test/policy/test-default-disable-use-apm.expected b/packages/zipkin_input_otel/_dev/test/policy/test-default-disable-use-apm.expected new file mode 100644 index 00000000000..9bfab820c31 --- /dev/null +++ b/packages/zipkin_input_otel/_dev/test/policy/test-default-disable-use-apm.expected @@ -0,0 +1,57 @@ +connectors: + forward: {} +exporters: + elasticsearch/componentid-0: + endpoints: + - https://elasticsearch:9200 +inputs: [] +output_permissions: + default: + _elastic_agent_checks: + cluster: + - monitor + _elastic_agent_monitoring: + indices: [] + uuid-for-permissions-on-related-indices: + indices: + - names: + - traces-*-* + privileges: + - auto_configure + - create_doc + - names: + - logs-generic.otel-* + privileges: + - auto_configure + - create_doc +processors: + transform/componentid-0: + trace_statements: + - context: span + statements: + - set(attributes["data_stream.type"], "traces") + - set(attributes["data_stream.dataset"], "zipkinreceiver") + - set(attributes["data_stream.namespace"], "ep") + - context: spanevent + statements: + - set(attributes["data_stream.type"], "logs") + - set(attributes["data_stream.namespace"], "ep") +receivers: + zipkin/componentid-0: + endpoint: 0.0.0.0:9411 + parse_string_tags: true +secret_references: [] +service: + pipelines: + traces: + exporters: + - elasticsearch/componentid-0 + receivers: + - forward + traces/componentid-0: + exporters: + - forward + processors: + - transform/componentid-0 + receivers: + - zipkin/componentid-0 diff --git a/packages/zipkin_input_otel/_dev/test/policy/test-default-disable-use-apm.yml b/packages/zipkin_input_otel/_dev/test/policy/test-default-disable-use-apm.yml new file mode 100644 index 00000000000..70e101c31d5 --- /dev/null +++ b/packages/zipkin_input_otel/_dev/test/policy/test-default-disable-use-apm.yml @@ -0,0 +1,4 @@ +vars: + endpoint: "0.0.0.0:9411" + parse_string_tags: true + use_apm: false diff --git a/packages/zipkin_input_otel/_dev/test/policy/test-default-use-apm.expected b/packages/zipkin_input_otel/_dev/test/policy/test-default-use-apm.expected new file mode 100644 index 00000000000..005a7c72b66 --- /dev/null +++ b/packages/zipkin_input_otel/_dev/test/policy/test-default-use-apm.expected @@ -0,0 +1,83 @@ +connectors: + elasticapm/componentid-0: {} + forward: {} +exporters: + elasticsearch/componentid-0: + endpoints: + - https://elasticsearch:9200 +inputs: [] +output_permissions: + default: + _elastic_agent_checks: + cluster: + - monitor + _elastic_agent_monitoring: + indices: [] + uuid-for-permissions-on-related-indices: + indices: + - names: + - traces-*-* + privileges: + - auto_configure + - create_doc + - names: + - logs-generic.otel-* + privileges: + - auto_configure + - create_doc + - names: + - metrics-*-* + privileges: + - auto_configure + - create_doc +processors: + elasticapm/componentid-0: {} + transform/componentid-0: + metric_statements: + - context: datapoint + statements: + - set(attributes["data_stream.namespace"], "ep") + transform/componentid-1: + trace_statements: + - context: span + statements: + - set(attributes["data_stream.type"], "traces") + - set(attributes["data_stream.dataset"], "zipkinreceiver") + - set(attributes["data_stream.namespace"], "ep") + - context: spanevent + statements: + - set(attributes["data_stream.type"], "logs") + - set(attributes["data_stream.namespace"], "ep") +receivers: + zipkin/componentid-0: + endpoint: 0.0.0.0:9411 + parse_string_tags: true +secret_references: [] +service: + pipelines: + metrics: + exporters: + - elasticsearch/componentid-0 + receivers: + - forward + metrics/componentid-1: + exporters: + - forward + processors: + - transform/componentid-0 + receivers: + - elasticapm/componentid-0 + traces: + exporters: + - elasticsearch/componentid-0 + receivers: + - forward + traces/componentid-0: + exporters: + - elasticapm/componentid-0 + - forward + processors: + - elasticapm/componentid-0 + - transform/componentid-1 + receivers: + - zipkin/componentid-0 diff --git a/packages/zipkin_input_otel/_dev/test/policy/test-default-use-apm.yml b/packages/zipkin_input_otel/_dev/test/policy/test-default-use-apm.yml new file mode 100644 index 00000000000..7b383dfd445 --- /dev/null +++ b/packages/zipkin_input_otel/_dev/test/policy/test-default-use-apm.yml @@ -0,0 +1,4 @@ +vars: + endpoint: "0.0.0.0:9411" + parse_string_tags: true + use_apm: true diff --git a/packages/zipkin_input_otel/_dev/test/policy/test-default-vars.expected b/packages/zipkin_input_otel/_dev/test/policy/test-default-vars.expected new file mode 100644 index 00000000000..c23cff1583a --- /dev/null +++ b/packages/zipkin_input_otel/_dev/test/policy/test-default-vars.expected @@ -0,0 +1,83 @@ +connectors: + elasticapm/componentid-0: {} + forward: {} +exporters: + elasticsearch/componentid-0: + endpoints: + - https://elasticsearch:9200 +inputs: [] +output_permissions: + default: + _elastic_agent_checks: + cluster: + - monitor + _elastic_agent_monitoring: + indices: [] + uuid-for-permissions-on-related-indices: + indices: + - names: + - traces-*-* + privileges: + - auto_configure + - create_doc + - names: + - logs-generic.otel-* + privileges: + - auto_configure + - create_doc + - names: + - metrics-*-* + privileges: + - auto_configure + - create_doc +processors: + elasticapm/componentid-0: {} + transform/componentid-0: + metric_statements: + - context: datapoint + statements: + - set(attributes["data_stream.namespace"], "ep") + transform/componentid-1: + trace_statements: + - context: span + statements: + - set(attributes["data_stream.type"], "traces") + - set(attributes["data_stream.dataset"], "zipkinreceiver") + - set(attributes["data_stream.namespace"], "ep") + - context: spanevent + statements: + - set(attributes["data_stream.type"], "logs") + - set(attributes["data_stream.namespace"], "ep") +receivers: + zipkin/componentid-0: + endpoint: localhost:9411 + parse_string_tags: false +secret_references: [] +service: + pipelines: + metrics: + exporters: + - elasticsearch/componentid-0 + receivers: + - forward + metrics/componentid-1: + exporters: + - forward + processors: + - transform/componentid-0 + receivers: + - elasticapm/componentid-0 + traces: + exporters: + - elasticsearch/componentid-0 + receivers: + - forward + traces/componentid-0: + exporters: + - elasticapm/componentid-0 + - forward + processors: + - elasticapm/componentid-0 + - transform/componentid-1 + receivers: + - zipkin/componentid-0 diff --git a/packages/zipkin_input_otel/_dev/test/policy/test-default-vars.yml b/packages/zipkin_input_otel/_dev/test/policy/test-default-vars.yml new file mode 100644 index 00000000000..72b4ca320df --- /dev/null +++ b/packages/zipkin_input_otel/_dev/test/policy/test-default-vars.yml @@ -0,0 +1 @@ +vars: ~ diff --git a/packages/zipkin_input_otel/_dev/test/policy/test-default.expected b/packages/zipkin_input_otel/_dev/test/policy/test-default.expected new file mode 100644 index 00000000000..005a7c72b66 --- /dev/null +++ b/packages/zipkin_input_otel/_dev/test/policy/test-default.expected @@ -0,0 +1,83 @@ +connectors: + elasticapm/componentid-0: {} + forward: {} +exporters: + elasticsearch/componentid-0: + endpoints: + - https://elasticsearch:9200 +inputs: [] +output_permissions: + default: + _elastic_agent_checks: + cluster: + - monitor + _elastic_agent_monitoring: + indices: [] + uuid-for-permissions-on-related-indices: + indices: + - names: + - traces-*-* + privileges: + - auto_configure + - create_doc + - names: + - logs-generic.otel-* + privileges: + - auto_configure + - create_doc + - names: + - metrics-*-* + privileges: + - auto_configure + - create_doc +processors: + elasticapm/componentid-0: {} + transform/componentid-0: + metric_statements: + - context: datapoint + statements: + - set(attributes["data_stream.namespace"], "ep") + transform/componentid-1: + trace_statements: + - context: span + statements: + - set(attributes["data_stream.type"], "traces") + - set(attributes["data_stream.dataset"], "zipkinreceiver") + - set(attributes["data_stream.namespace"], "ep") + - context: spanevent + statements: + - set(attributes["data_stream.type"], "logs") + - set(attributes["data_stream.namespace"], "ep") +receivers: + zipkin/componentid-0: + endpoint: 0.0.0.0:9411 + parse_string_tags: true +secret_references: [] +service: + pipelines: + metrics: + exporters: + - elasticsearch/componentid-0 + receivers: + - forward + metrics/componentid-1: + exporters: + - forward + processors: + - transform/componentid-0 + receivers: + - elasticapm/componentid-0 + traces: + exporters: + - elasticsearch/componentid-0 + receivers: + - forward + traces/componentid-0: + exporters: + - elasticapm/componentid-0 + - forward + processors: + - elasticapm/componentid-0 + - transform/componentid-1 + receivers: + - zipkin/componentid-0 diff --git a/packages/zipkin_input_otel/_dev/test/policy/test-default.yml b/packages/zipkin_input_otel/_dev/test/policy/test-default.yml new file mode 100644 index 00000000000..5893fe8d4fb --- /dev/null +++ b/packages/zipkin_input_otel/_dev/test/policy/test-default.yml @@ -0,0 +1,3 @@ +vars: + endpoint: "0.0.0.0:9411" + parse_string_tags: true diff --git a/packages/zipkin_input_otel/_dev/test/policy/test-tls.expected b/packages/zipkin_input_otel/_dev/test/policy/test-tls.expected new file mode 100644 index 00000000000..8f89b7b1d69 --- /dev/null +++ b/packages/zipkin_input_otel/_dev/test/policy/test-tls.expected @@ -0,0 +1,90 @@ +connectors: + elasticapm/componentid-0: {} + forward: {} +exporters: + elasticsearch/componentid-0: + endpoints: + - https://elasticsearch:9200 +inputs: [] +output_permissions: + default: + _elastic_agent_checks: + cluster: + - monitor + _elastic_agent_monitoring: + indices: [] + uuid-for-permissions-on-related-indices: + indices: + - names: + - traces-*-* + privileges: + - auto_configure + - create_doc + - names: + - logs-generic.otel-* + privileges: + - auto_configure + - create_doc + - names: + - metrics-*-* + privileges: + - auto_configure + - create_doc +processors: + elasticapm/componentid-0: {} + transform/componentid-0: + metric_statements: + - context: datapoint + statements: + - set(attributes["data_stream.namespace"], "ep") + transform/componentid-1: + trace_statements: + - context: span + statements: + - set(attributes["data_stream.type"], "traces") + - set(attributes["data_stream.dataset"], "zipkinreceiver") + - set(attributes["data_stream.namespace"], "ep") + - context: spanevent + statements: + - set(attributes["data_stream.type"], "logs") + - set(attributes["data_stream.namespace"], "ep") +receivers: + zipkin/componentid-0: + endpoint: 0.0.0.0:9411 + parse_string_tags: true + tls: + ca_file: /path/to/ca.crt + cert_file: /path/to/client.crt + include_system_ca_certs_pool: true + key_file: /path/to/client.key + max_version: "1.3" + min_version: "1.2" +secret_references: [] +service: + pipelines: + metrics: + exporters: + - elasticsearch/componentid-0 + receivers: + - forward + metrics/componentid-1: + exporters: + - forward + processors: + - transform/componentid-0 + receivers: + - elasticapm/componentid-0 + traces: + exporters: + - elasticsearch/componentid-0 + receivers: + - forward + traces/componentid-0: + exporters: + - elasticapm/componentid-0 + - forward + processors: + - elasticapm/componentid-0 + - transform/componentid-1 + receivers: + - zipkin/componentid-0 diff --git a/packages/zipkin_input_otel/_dev/test/policy/test-tls.yml b/packages/zipkin_input_otel/_dev/test/policy/test-tls.yml new file mode 100644 index 00000000000..6cab88dfc04 --- /dev/null +++ b/packages/zipkin_input_otel/_dev/test/policy/test-tls.yml @@ -0,0 +1,10 @@ +vars: + endpoint: "0.0.0.0:9411" + parse_string_tags: true + tls_enabled: true + tls_ca_file: "/path/to/ca.crt" + tls_cert_file: "/path/to/client.crt" + tls_key_file: "/path/to/client.key" + tls_min_version: "1.2" + tls_max_version: "1.3" + tls_include_system_ca_certs_pool: true diff --git a/packages/zipkin_input_otel/_dev/test/system/test-default-config.yml b/packages/zipkin_input_otel/_dev/test/system/test-default-config.yml new file mode 100644 index 00000000000..2751f845da5 --- /dev/null +++ b/packages/zipkin_input_otel/_dev/test/system/test-default-config.yml @@ -0,0 +1,6 @@ +service: backend +vars: + endpoint: "0.0.0.0:9411" + parse_string_tags: false +assert: + min_count: 20 diff --git a/packages/zipkin_input_otel/agent/input/input.yml.hbs b/packages/zipkin_input_otel/agent/input/input.yml.hbs new file mode 100644 index 00000000000..3ee9a8b555c --- /dev/null +++ b/packages/zipkin_input_otel/agent/input/input.yml.hbs @@ -0,0 +1,27 @@ +receivers: + zipkin: + endpoint: {{endpoint}} + parse_string_tags: {{parse_string_tags}} +{{#if tls_enabled}} + tls: +{{#if tls_ca_file}} + ca_file: {{tls_ca_file}} +{{/if}} +{{#if tls_cert_file}} + cert_file: {{tls_cert_file}} +{{/if}} +{{#if tls_key_file}} + key_file: {{tls_key_file}} +{{/if}} + min_version: "{{tls_min_version}}" +{{#if tls_max_version}} + max_version: "{{tls_max_version}}" +{{/if}} +{{#if tls_include_system_ca_certs_pool}} + include_system_ca_certs_pool: {{tls_include_system_ca_certs_pool}} +{{/if}} +{{/if}} +service: + pipelines: + traces: + receivers: [zipkin] diff --git a/packages/zipkin_input_otel/changelog.yml b/packages/zipkin_input_otel/changelog.yml new file mode 100644 index 00000000000..ed6aabd03e3 --- /dev/null +++ b/packages/zipkin_input_otel/changelog.yml @@ -0,0 +1,6 @@ +# newer versions go on top +- version: "0.1.0" + changes: + - description: Initial draft of the package + type: enhancement + link: https://github.com/elastic/integrations/pull/17226 diff --git a/packages/zipkin_input_otel/docs/README.md b/packages/zipkin_input_otel/docs/README.md new file mode 100644 index 00000000000..80968afe732 --- /dev/null +++ b/packages/zipkin_input_otel/docs/README.md @@ -0,0 +1,22 @@ +# Zipkin OpenTelemetry Input Package + +## Overview +The Zipkin OpenTelemetry Input Package for Elastic enables collection of trace data from applications instrumented with [Zipkin](https://zipkin.io/) through OpenTelemetry protocols using the [zipkinreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/zipkinreceiver#zipkin-receiver). + +### How it works +This package receives Zipkin trace data (V1 and V2 JSON/Protobuf formats) by configuring the Zipkin receiver in the Input Package, which then gets applied to the zipkinreceiver present in the EDOT collector, which then forwards the data to Elastic Agent. The Elastic Agent processes and enriches the data before sending it to Elasticsearch for indexing and analysis. + +## Configuration + +For the full list of settings exposed for the receiver and examples, refer to the [Zipkin Receiver documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/zipkinreceiver). + +## Troubleshooting + +If you encounter issues: + +1. Verify the endpoint is accessible and not blocked by a firewall. +2. Ensure applications are sending Zipkin-formatted traces to the configured endpoint (default: `http://:9411`). +3. Check the Elastic Agent logs for any receiver errors. + +## Traces reference +For more details about the Zipkin receiver and its configuration options, refer to the [Zipkin Receiver documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/zipkinreceiver) in the upstream OpenTelemetry Collector repository. diff --git a/packages/zipkin_input_otel/img/zipkin_symbol_logo_otel.svg b/packages/zipkin_input_otel/img/zipkin_symbol_logo_otel.svg new file mode 100644 index 00000000000..06e4a16fde1 --- /dev/null +++ b/packages/zipkin_input_otel/img/zipkin_symbol_logo_otel.svg @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/zipkin_input_otel/manifest.yml b/packages/zipkin_input_otel/manifest.yml new file mode 100644 index 00000000000..3005fb79140 --- /dev/null +++ b/packages/zipkin_input_otel/manifest.yml @@ -0,0 +1,110 @@ +format_version: 3.5.0 +name: zipkin_input_otel +title: "Zipkin OpenTelemetry Input Package" +version: "0.1.0" +source: + license: "Elastic-2.0" +description: "Collect Zipkin traces using OpenTelemetry Collector" +type: input +categories: + - observability + - opentelemetry +conditions: + kibana: + version: "^9.4.0" + elastic: + subscription: "basic" +icons: + - src: /img/zipkin_symbol_logo_otel.svg + title: Zipkin OTel logo + size: 32x32 + type: image/svg+xml +policy_templates: + - name: zipkinreceiver + type: traces + title: Zipkin OpenTelemetry Input + description: Collect Zipkin traces using OpenTelemetry Collector + input: otelcol + template_path: input.yml.hbs + vars: + - name: endpoint + type: text + title: Endpoint + required: true + description: The host:port address to listen on for Zipkin spans. + default: localhost:9411 + show_user: true + - name: parse_string_tags + type: bool + title: Parse String Tags + required: false + description: If enabled, string tags/binary annotations will be parsed into int/bool/float types. + default: false + show_user: true + # TLS settings + - name: tls_enabled + type: bool + required: false + title: Enable TLS Configuration + description: Enable TLS for the Zipkin receiver listener. + default: false + show_user: true + - name: tls_ca_file + type: text + required: false + title: TLS CA File + description: Path to the CA certificate file for server certificate verification. Only used when TLS is enabled. + show_user: false + - name: tls_cert_file + type: text + required: false + title: TLS Certificate File + description: Path to the TLS certificate file for client authentication. + show_user: false + - name: tls_key_file + type: text + required: false + title: TLS Key File + description: Path to the TLS key file for client authentication. + show_user: false + - name: tls_min_version + type: select + required: false + title: TLS Min Version + description: Minimum acceptable TLS version. Default is 1.2. + show_user: false + options: + - text: "1.0" + value: "1.0" + - text: "1.1" + value: "1.1" + - text: "1.2" + value: "1.2" + - text: "1.3" + value: "1.3" + default: "1.2" + - name: tls_max_version + type: select + required: false + title: TLS Max Version + description: Maximum acceptable TLS version. + show_user: false + options: + - text: "1.0" + value: "1.0" + - text: "1.1" + value: "1.1" + - text: "1.2" + value: "1.2" + - text: "1.3" + value: "1.3" + - name: tls_include_system_ca_certs_pool + type: bool + required: false + title: Include System CA Certs Pool + description: Whether to load the system certificate authorities pool alongside the certificate authority. + default: false + show_user: false +owner: + github: elastic/ecosystem + type: elastic diff --git a/packages/zipkin_input_otel/sample_event.json b/packages/zipkin_input_otel/sample_event.json new file mode 100644 index 00000000000..259e8c06d2a --- /dev/null +++ b/packages/zipkin_input_otel/sample_event.json @@ -0,0 +1,120 @@ +{ + "@timestamp": "2026-03-26T12:25:35.754Z", + "agent": { + "name": "otlp", + "version": "unknown" + }, + "attributes": { + "error": "404", + "event": { + "outcome": "failure", + "success_count": 0 + }, + "http": { + "method": "GET", + "path": "/", + "status_code": "404" + }, + "net": { + "host": { + "ip": "172.20.0.2" + }, + "peer": { + "ip": "172.20.0.3", + "port": 57164 + } + }, + "processor": { + "event": "transaction" + }, + "timestamp": { + "us": 1774527935754203 + }, + "transaction": { + "duration": { + "us": 1232 + }, + "id": "9ad9a59b1209fab2", + "name": "GET /*", + "representative_count": 1, + "result": "Error", + "root": true, + "sampled": true, + "type": "request" + } + }, + "data_stream": { + "dataset": "zipkinreceiver.otel", + "namespace": "18683", + "type": "traces" + }, + "duration": 1232000, + "error": "404", + "event": { + "agent_id_status": "missing", + "dataset": "zipkinreceiver.otel", + "ingested": "2026-03-26T12:25:46Z", + "outcome": "failure", + "success_count": 0 + }, + "http": { + "method": "GET", + "path": "/", + "status_code": "404" + }, + "kind": "Server", + "name": "GET /*", + "net": { + "host": { + "ip": "172.20.0.2" + }, + "peer": { + "ip": "172.20.0.3", + "port": 57164 + } + }, + "processor": { + "event": "transaction" + }, + "resource": { + "attributes": { + "agent": { + "name": "otlp", + "version": "unknown" + }, + "service": { + "name": "backend" + } + } + }, + "service": { + "name": "backend" + }, + "span": { + "id": "9ad9a59b1209fab2", + "name": "GET /*" + }, + "span_id": "9ad9a59b1209fab2", + "status": { + "code": "Error" + }, + "timestamp": { + "us": 1774527935754203 + }, + "trace": { + "id": "00000000000000009ad9a59b1209fab2" + }, + "trace_id": "00000000000000009ad9a59b1209fab2", + "transaction": { + "duration": { + "us": 1232 + }, + "id": "9ad9a59b1209fab2", + "name": "GET /*", + "representative_count": 1, + "result": "Error", + "root": true, + "sampled": true, + "type": "request" + } +}