This repository has been archived by the owner on Apr 2, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for OTEL collector endpoint in Promscale tracing telemetr…
…y exporter In addition to Jaeger, now Promscale can send its telemetry data to OTEL collector endpoint. Since this is an endpoint that Promscale itself exposes, we can actually ingest tracing data from Promscale into Promscale itself.
- Loading branch information
1 parent
9391f8c
commit 73d7c71
Showing
7 changed files
with
128 additions
and
9 deletions.
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
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
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
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
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
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,31 @@ | ||
package tracer | ||
|
||
import ( | ||
"google.golang.org/grpc/encoding" | ||
"google.golang.org/protobuf/proto" | ||
) | ||
|
||
// clientCodec is used to force the gRPC client into the | ||
// specific codec that works with OTEL exporter. | ||
type clientCodec struct{} | ||
|
||
var _ encoding.Codec = (*clientCodec)(nil) | ||
|
||
func newClientCodec() *clientCodec { | ||
return &clientCodec{} | ||
} | ||
|
||
// Name implements encoding.Codec | ||
func (c *clientCodec) Name() string { | ||
return "proto" | ||
} | ||
|
||
// Marshal implements encoding.Codec | ||
func (c *clientCodec) Marshal(v interface{}) ([]byte, error) { | ||
return proto.Marshal(v.(proto.Message)) | ||
} | ||
|
||
// Unmarshal implements encoding.Codec | ||
func (c *clientCodec) Unmarshal(data []byte, v interface{}) error { | ||
return proto.Unmarshal(data, v.(proto.Message)) | ||
} |
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