diff --git a/opentelemetry-cpp.yaml b/opentelemetry-cpp.yaml new file mode 100644 index 0000000000..37ae978506 --- /dev/null +++ b/opentelemetry-cpp.yaml @@ -0,0 +1,59 @@ +package: + name: opentelemetry-cpp + version: 1.17.0 + epoch: 0 + description: The OpenTelemetry C++ Client + copyright: + - license: Apache-2.0 + +environment: + contents: + packages: + - abseil-cpp-dev + - benchmark-dev + - busybox + - c-ares-dev + - cmake + - gcc + - glibc-dev + - grpc-dev + - gtest-dev + - icu-dev + - make + - openssl-dev + - pkgconf + - protobuf-dev + - re2-dev + - systemd-dev + +pipeline: + - uses: git-checkout + with: + repository: https://github.com/open-telemetry/opentelemetry-cpp + tag: v${{package.version}} + expected-commit: fa0a5200ddbe9ae6f487a228e658aedc102dab56 + + - uses: cmake/configure + with: + opts: -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=ON -DWITH_OTLP_GRPC=ON -DWITH_ABSEIL=ON + + - uses: cmake/build + + - uses: cmake/install + + - uses: strip + +subpackages: + - name: opentelemetry-cpp-dev + description: The OpenTelemetry C++ Client development files + dependencies: + runtime: + - opentelemetry-cpp + pipeline: + - uses: split/dev + +update: + enabled: true + github: + identifier: open-telemetry/opentelemetry-cpp + strip-prefix: v diff --git a/opentelemetry-plugin-nginx.yaml b/opentelemetry-plugin-nginx.yaml new file mode 100644 index 0000000000..a750da272d --- /dev/null +++ b/opentelemetry-plugin-nginx.yaml @@ -0,0 +1,125 @@ +#nolint:valid-pipeline-git-checkout-tag +package: + name: opentelemetry-plugin-nginx + version: 0_git20241010 + epoch: 0 + description: Adds OpenTelemetry distributed tracing support to nginx. This is the otel community plugin for nginx, not the official nginx plugin for otel. + copyright: + - license: Apache-2.0 + dependencies: + runtime: + - opentelemetry-cpp + +environment: + contents: + packages: + - abseil-cpp-dev + - busybox + - c-ares-dev + - cmake + - curl-dev + - gcc + - glibc-dev + - grpc-dev + - icu-dev + - make + - nginx + - opentelemetry-cpp-dev + - pcre-dev + - protobuf-c-dev + - protobuf-dev + - re2-dev + - systemd-dev + +pipeline: + - uses: git-checkout + with: + repository: https://github.com/open-telemetry/opentelemetry-cpp-contrib + branch: main + expected-commit: f6d29426ee9b4d6b476c09ca3cb9bed3cf23906f + + - uses: cmake/configure + working-directory: instrumentation/nginx + + - uses: cmake/build + working-directory: instrumentation/nginx + + - runs: | + mkdir -p ${{targets.contextdir}}/usr/share/nginx/modules + cp -p otel_ngx_module.so ${{targets.contextdir}}/usr/share/nginx/modules/ + working-directory: instrumentation/nginx/output + + - uses: strip + +update: + enabled: true + git: {} + schedule: + period: weekly + reason: shared contrib repo that doesn't maintain tags for this component + +test: + environment: + contents: + packages: + - nginx + pipeline: + - uses: git-checkout + with: + repository: https://github.com/open-telemetry/opentelemetry-cpp-contrib + branch: main + expected-commit: f6d29426ee9b4d6b476c09ca3cb9bed3cf23906f + - runs: | + cat < /etc/nginx/nginx.conf + load_module /usr/share/nginx/modules/otel_ngx_module.so; + + user nobody; + + http { + opentelemetry_config /etc/nginx/otel-nginx.toml; + + server { + listen 80; + server_name otel_example; + + root /var/www/html; + + location = / { + opentelemetry_operation_name my_example_backend; + opentelemetry_propagate; + proxy_pass http://localhost:3500/; + } + } + } + events {} + EOF + + cat < /etc/nginx/otel-nginx.toml + exporter = "otlp" + processor = "batch" + + [exporters.otlp] + # Alternatively the OTEL_EXPORTER_OTLP_ENDPOINT environment variable can also be used. + host = "localhost" + port = 4317 + + [processors.batch] + max_queue_size = 2048 + schedule_delay_millis = 5000 + max_export_batch_size = 512 + + [service] + # Can also be set by the OTEL_SERVICE_NAME environment variable. + name = "nginx-proxy" # Opentelemetry resource name + + [sampler] + name = "AlwaysOn" # Also: AlwaysOff, TraceIdRatioBased + ratio = 0.1 + parent_based = false + EOF + + # Not sure why this isn't included in main package. + mkdir -p /var/lib/nginx/tmp/ + # -T: test the configuration file: nginx checks the configuration for correct syntax, and then tries to open files referred in the configuration. + # additionally dump configuration files to standard output (1.9.2). + - runs: nginx -T