Skip to content

Commit 9e18e04

Browse files
authored
Merge branch 'main' into modify-batchProcessor-test-use-flush-instead-of-sleeptime
2 parents 5013311 + 81fea07 commit 9e18e04

File tree

53 files changed

+518
-312
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+518
-312
lines changed

.github/workflows/pr_naming.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: PR Conventional Commit Validation
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, edited]
6+
7+
jobs:
8+
validate-pr-title:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: PR Conventional Commit Validation
12+
uses: ytanikin/[email protected]
13+
with:
14+
task_types: '["build","chore","ci","docs","feat","fix","perf","refactor","revert","test"]'
15+
add_label: 'false'

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ Open a pull request against the main
7878
[opentelemetry-rust](https://github.com/open-telemetry/opentelemetry-rust)
7979
repo.
8080

81+
Your pull request should be named according to the
82+
[conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) standard. This ensures that
83+
when the PR is squashed into `main`, the resulting commit message is consistent and makes it easier
84+
for us to generate a changelog standard.
85+
8186
> **Note**
8287
> It is recommended to run [pre-commit script](scripts/precommit.sh) to catch any issues locally.
8388

Cargo.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,31 @@ tracing = { version = ">=0.1.40", default-features = false }
5353
tracing-core = { version = ">=0.1.33", default-features = false }
5454
tracing-subscriber = { version = "0.3", default-features = false }
5555
url = { version = "2.5", default-features = false }
56+
anyhow = "1.0.94"
57+
base64 = "0.22.1"
58+
chrono = { version = "0.4.34", default-features = false }
59+
ctor = "0.2.9"
60+
ctrlc = "3.2.5"
61+
futures-channel = "0.3"
62+
futures-sink = "0.3"
63+
glob = "0.3.1"
64+
hex = "0.4.3"
65+
lazy_static = "1.4.0"
66+
num-format = "0.4.4"
67+
num_cpus = "1.15.0"
68+
opentelemetry-appender-tracing = { path = "opentelemetry-appender-tracing", default-features = false }
69+
opentelemetry-otlp = { path = "opentelemetry-otlp" }
70+
opentelemetry-stdout = { path = "opentelemetry-stdout" }
71+
percent-encoding = "2.0"
72+
rstest = "0.23.0"
73+
schemars = "0.8"
74+
sysinfo = "0.32"
75+
tempfile = "3.3.0"
76+
testcontainers = "0.23.1"
77+
tracing-log = "0.2"
78+
tracing-opentelemetry = "0.29"
79+
typed-builder = "0.20"
80+
uuid = "1.3"
5681

5782
# Aviod use of crates.io version of these crates through the tracing-opentelemetry dependencies
5883
[patch.crates-io]

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ you're more than welcome to participate!
186186
### Approvers
187187

188188
* [Shaun Cox](https://github.com/shaun-cox)
189+
* [Scott Gerring](https://github.com/scottgerring)
189190

190191
### Emeritus
191192

docs/design/logs.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,22 @@ this crate.
280280
## Performance
281281

282282
// Call out things done specifically for performance
283+
// Rough draft
284+
285+
1. `LogRecord` is stack allocated and not Boxed unless required by the component
286+
needing to store it beyond the logging call. (eg: BatchProcessor)
287+
2. LogRecords's Attribute storage is specially designed struct, that holds up to
288+
five attributes in stack.
289+
3. When passing `LogRecord`s to processor, a mutable ref is passed. This allows
290+
calling multiple processors one after another, without the need for cloning.
291+
4. `Logger` provides a `Enabled` check which can optimize performance when
292+
no-one is interested in the log. The check is passed from `Logger` to the
293+
processor, which may consult its exporter to make the decision. An example use
294+
case - an ETW or user-events exporter can check for the presence of listener and
295+
convey that decision back to logger, allowing appender to avoid even the cost of
296+
creating a `LogRecord` in the first place if there is no listener. This check is
297+
done for each log emission, and can react dynamically to changes in interest, by
298+
enabling/disabling ETW/user-event listener.
283299

284300
### Perf test - benchmarks
285301

@@ -289,6 +305,23 @@ this crate.
289305

290306
// Share ~~ numbers
291307

308+
## Internal logs
309+
310+
OTel itself is instrumented with `tracing` crate to emit internal logs about its
311+
operations. This is feature gated under "internal-logs", and is enabled by
312+
default for all components. The `opentelemetry` provide few helper macros
313+
`otel_warn` etc., which in turn invokes various `tracing` macros like `warn!`
314+
etc. The cargo package name will be set as `target` when using `tracing`. For
315+
example, logs from `opentelemetry-otlp` will have target set to
316+
"opentelemetry-otlp".
317+
318+
The helper macros are part of public API, so can be used by anyone. But it is
319+
only meant for OTel components itself and anyone writing extensions like custom
320+
Exporters etc.
321+
322+
// TODO: Document the principles followed when selecting severity for internal
323+
logs // TODO: Document how this can cause circular loop and plans to address it.
324+
292325
## Summary
293326

294327
- OpenTelemetry Logs does not provide a user-facing logging API.

examples/logs-basic/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ publish = false
77

88
[dependencies]
99
opentelemetry_sdk = { path = "../../opentelemetry-sdk", features = ["logs"] }
10-
opentelemetry-stdout = { path = "../../opentelemetry-stdout", features = ["logs"]}
11-
opentelemetry-appender-tracing = { path = "../../opentelemetry-appender-tracing", default-features = false}
10+
opentelemetry-stdout = { workspace = true, features = ["logs"] }
11+
opentelemetry-appender-tracing = { workspace = true }
1212
tracing = { workspace = true, features = ["std"]}
1313
tracing-subscriber = { workspace = true, features = ["env-filter","registry", "std", "fmt"] }

examples/metrics-advanced/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ publish = false
88
[dependencies]
99
opentelemetry = { path = "../../opentelemetry", features = ["metrics"] }
1010
opentelemetry_sdk = { path = "../../opentelemetry-sdk", features = ["spec_unstable_metrics_views", "rt-tokio"] }
11-
opentelemetry-stdout = { path = "../../opentelemetry-stdout", features = ["metrics"] }
11+
opentelemetry-stdout = { workspace = true, features = ["metrics"] }
1212
tokio = { workspace = true, features = ["full"] }

examples/metrics-basic/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ publish = false
88
[dependencies]
99
opentelemetry = { path = "../../opentelemetry", features = ["metrics"] }
1010
opentelemetry_sdk = { path = "../../opentelemetry-sdk", features = ["metrics", "rt-tokio"] }
11-
opentelemetry-stdout = { path = "../../opentelemetry-stdout", features = ["metrics"]}
11+
opentelemetry-stdout = { workspace = true, features = ["metrics"] }
1212
tokio = { workspace = true, features = ["full"] }
1313

examples/tracing-grpc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ path = "src/client.rs"
1616
[dependencies]
1717
opentelemetry = { path = "../../opentelemetry" }
1818
opentelemetry_sdk = { path = "../../opentelemetry-sdk", features = ["rt-tokio"] }
19-
opentelemetry-stdout = { path = "../../opentelemetry-stdout", features = ["trace"] }
19+
opentelemetry-stdout = { workspace = true, features = ["trace"] }
2020
prost = { workspace = true }
2121
tokio = { workspace = true, features = ["full"] }
2222
tonic = { workspace = true, features = ["server"] }

examples/tracing-http-propagator/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ tokio = { workspace = true, features = ["full"] }
2323
opentelemetry = { path = "../../opentelemetry" }
2424
opentelemetry_sdk = { path = "../../opentelemetry-sdk" }
2525
opentelemetry-http = { path = "../../opentelemetry-http" }
26-
opentelemetry-stdout = { path = "../../opentelemetry-stdout", features = ["trace"] }
26+
opentelemetry-stdout = { workspace = true, features = ["trace"] }
2727
opentelemetry-semantic-conventions = { path = "../../opentelemetry-semantic-conventions" }

0 commit comments

Comments
 (0)