-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add otel-plugin-nginx, otel-cpp #30305
Open
wlynch
wants to merge
2
commits into
wolfi-dev:main
Choose a base branch
from
wlynch:otel-nginx
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
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 | ||
|
||
update: | ||
enabled: true | ||
github: | ||
identifier: open-telemetry/opentelemetry-cpp | ||
strip-prefix: v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
#nolint:valid-pipeline-git-checkout-tag | ||
package: | ||
name: opentelemetry-plugin-nginx | ||
version: 0_git20241009 | ||
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 | ||
- 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 | ||
|
||
wlynch marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 <<EOF > /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 <<EOF > /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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any docs/infodirs we can split into subpackages, development files. etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I was wondering about this - I didn't see any documentation about this in the wiki. What are the common subpackage breakdowns we aim for, what kinds of files go in them, and what naming conventions should each subpackage have?
Here's the file extension breakdown for files in the package:
I can probably break out the headers, but what about cmake/pc? Are those considered development files, or should they go in a separate package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have pipelines in melange that can be used to split things away: https://github.com/chainguard-dev/melange/tree/main/pkg/build/pipelines/split
Typically, we split whatever we can. I.E., those headers (the
.h
files) would be split away withsplit/dev
and docs would be split withsplit/manpages
andsplit/info
if an info directory exists. It looks like in your case, you just need to create a-dev
subpackage that uses thesplit/dev
pipeline