Skip to content
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

Prepare for v0.4 release for user_events exporters for metrics and logs #63

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ resolver = "2"
debug = 1

[workspace.dependencies]
opentelemetry = "0.22"
opentelemetry-appender-tracing = "0.3"
opentelemetry-http = "0.11"
opentelemetry-proto = { version = "0.5", default-features = false }
opentelemetry_sdk = { version = "0.22", default-features = false }
opentelemetry-stdout = "0.3"
opentelemetry-semantic-conventions = "0.14"
opentelemetry = "0.23"
opentelemetry-appender-tracing = "0.4"
opentelemetry-http = "0.12"
opentelemetry-proto = { version = "0.6", default-features = false }
opentelemetry_sdk = { version = "0.23", default-features = false }
opentelemetry-stdout = "0.4"
opentelemetry-semantic-conventions = "0.15"
4 changes: 2 additions & 2 deletions opentelemetry-etw-logs/src/logs/exporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ impl ETWExporter {
let event_time: SystemTime = log_data
.record
.timestamp
.unwrap_or(log_data.record.observed_timestamp);
.or_else(|| log_data.record.observed_timestamp)
.unwrap_or_else(SystemTime::now); // observerd_timestamp will never be None as per otel specs

const COUNT_TIME: u8 = 1u8;
const PART_A_COUNT: u8 = COUNT_TIME;
Expand Down Expand Up @@ -430,7 +431,6 @@ mod tests {
let log_data = LogData {
instrumentation: Default::default(),
record: Default::default(),
resource: Default::default(),
};

let result = exporter.export_log_data(&log_data);
Expand Down
3 changes: 1 addition & 2 deletions opentelemetry-etw-logs/src/logs/reentrant_logprocessor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl opentelemetry_sdk::logs::LogProcessor for ReentrantLogProcessor {

// This is a no-op no special cleanup is required before
// shutdown.
fn shutdown(&mut self) -> LogResult<()> {
fn shutdown(&self) -> LogResult<()> {
Ok(())
}

Expand Down Expand Up @@ -100,7 +100,6 @@ mod tests {
let log_data = LogData {
instrumentation: Default::default(),
record: Default::default(),
resource: Default::default(),
};

processor.emit(log_data);
Expand Down
6 changes: 6 additions & 0 deletions opentelemetry-user-events-logs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Unreleased

## v0.4.0

### Changed

- Bump opentelemetry, opentelemetry_sdk version to 0.23.

## v0.3.0

### Changed
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-user-events-logs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ keywords = ["opentelemetry", "log", "trace", "user_events"]
license = "Apache-2.0"

[dependencies]
eventheader = "0.3.2"
eventheader_dynamic = "0.3.3"
eventheader = "0.4.0"
eventheader_dynamic = "0.4.0"
opentelemetry = { workspace = true, features = ["logs"] }
opentelemetry_sdk = { workspace = true, features = ["logs"] }
async-std = { version="1.6" }
Expand Down
3 changes: 2 additions & 1 deletion opentelemetry-user-events-logs/src/logs/exporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ impl UserEventsExporter {
let event_time: SystemTime = log_data
.record
.timestamp
.unwrap_or(log_data.record.observed_timestamp);
.or_else(|| log_data.record.observed_timestamp)
.unwrap_or_else(SystemTime::now); // observed_timestamp is always present as per otel specs.
cs_a_count += 1; // for event_time
eb.add_struct("PartA", cs_a_count, 0);
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl opentelemetry_sdk::logs::LogProcessor for ReentrantLogProcessor {

// This is a no-op no special cleanup is required before
// shutdown.
fn shutdown(&mut self) -> LogResult<()> {
fn shutdown(&self) -> LogResult<()> {
Ok(())
}

Expand Down
7 changes: 7 additions & 0 deletions opentelemetry-user-events-metrics/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Unreleased

## v0.4.0

### Changed

- Bump opentelemetry version to 0.23, opentelemetry_sdk version to 0.23,
opentelemetry-proto version to 0.6.

## v0.3.0

### Changed
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-user-events-metrics/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "opentelemetry-user-events-metrics"
version = "0.3.0"
version = "0.4.0"
description = "OpenTelemetry metrics exporter to user events"
homepage = "https://github.com/open-telemetry/opentelemetry-rust-contrib/tree/main/opentelemetry-user-events-metrics"
repository = "https://github.com/open-telemetry/opentelemetry-rust-contrib/tree/main/opentelemetry-user-events-metrics"
Expand All @@ -14,7 +14,7 @@ rust-version = "1.65"
opentelemetry = { workspace = true, features = ["metrics"] }
opentelemetry_sdk = { workspace = true, features = ["metrics", "rt-tokio"] }
opentelemetry-proto = { workspace = true, features = ["gen-tonic", "metrics"] }
eventheader = { version = "= 0.3.4" }
eventheader = { version = "= 0.4.0" }
async-trait = "0.1"
prost = "0.12"

Expand Down
Loading