Skip to content

Commit f5b1900

Browse files
authored
Update default OTLP port (#388)
1 parent 6d44f23 commit f5b1900

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

opentelemetry-otlp/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ First make sure you have a running version of the opentelemetry collector you
3838
want to send data to:
3939

4040
```shell
41-
$ docker run -p 55680:55680 otel/opentelemetry-collector-dev:latest
41+
$ docker run -p 4317:4317 otel/opentelemetry-collector-dev:latest
4242
```
4343

4444
Then install a new pipeline with the recommended defaults to start exporting
@@ -116,7 +116,7 @@ fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
116116
map.insert_bin("trace-proto-bin", MetadataValue::from_bytes(b"[binary data]"));
117117

118118
let (tracer, _uninstall) = opentelemetry_otlp::new_pipeline()
119-
.with_endpoint("localhost:55680")
119+
.with_endpoint("localhost:4317")
120120
.with_protocol(Protocol::Grpc)
121121
.with_metadata(map)
122122
.with_timeout(Duration::from_secs(3))

opentelemetry-otlp/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//! you want to send data to:
1313
//!
1414
//! ```shell
15-
//! $ docker run -p 55680:55680 otel/opentelemetry-collector-dev:latest
15+
//! $ docker run -p 4317:4317 otel/opentelemetry-collector-dev:latest
1616
//! ```
1717
//!
1818
//! Then install a new pipeline with the recommended defaults to start exporting
@@ -83,7 +83,7 @@
8383
//! map.insert_bin("trace-proto-bin", MetadataValue::from_bytes(b"[binary data]"));
8484
//!
8585
//! let (tracer, _uninstall) = opentelemetry_otlp::new_pipeline()
86-
//! .with_endpoint("localhost:55680")
86+
//! .with_endpoint("localhost:4317")
8787
//! .with_protocol(Protocol::Grpc)
8888
//! .with_metadata(map)
8989
//! .with_timeout(Duration::from_secs(3))

opentelemetry-otlp/src/span.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,13 @@ impl Into<grpcio::CompressionAlgorithms> for Compression {
143143
}
144144
}
145145

146+
const DEFAULT_OTLP_PORT: u16 = 4317;
147+
146148
impl Default for ExporterConfig {
147149
#[cfg(feature = "tonic")]
148150
fn default() -> Self {
149151
ExporterConfig {
150-
endpoint: String::from("localhost:55680"),
152+
endpoint: format!("localhost:{}", DEFAULT_OTLP_PORT),
151153
protocol: Protocol::Grpc,
152154
#[cfg(all(feature = "tonic", feature = "tls"))]
153155
tls_config: None,
@@ -161,7 +163,7 @@ impl Default for ExporterConfig {
161163
#[cfg(all(feature = "grpc-sys", not(feature = "tonic")))]
162164
fn default() -> Self {
163165
ExporterConfig {
164-
endpoint: String::from("localhost:55680"),
166+
endpoint: format!("localhost:{}", DEFAULT_OTLP_PORT),
165167
protocol: Protocol::Grpc,
166168
credentials: None,
167169
headers: None,

0 commit comments

Comments
 (0)