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

add opentelemetry output #234

Closed
wants to merge 8 commits into from
Closed

Conversation

evanzhang87
Copy link

use add_fields to build formatted fields, then send to OLPT server, just support log now

const (
	resourcePrefix       = "oltp_resource_"
	scopePrefix          = "oltp_scope_"
	scopeName            = "oltp_scope_name"
	scopeVersion         = "oltp_scope_version"
	scopeSchemaUrl       = "oltp_scope_schemaurl"
	recordPrefix         = "oltp_logrecords_"
	recordTime           = "oltp_logrecords_time"
	recordSeverity       = "oltp_logrecords_severity"
	recordSeverityNumber = "oltp_logrecords_severitynumber"
	recordFlags          = "oltp_logrecords_flags"
	recordTraceId        = "oltp_logrecords_traceid"
	recordSpanId         = "oltp_logrecords_spanid"
	recordBody           = "oltp_logrecords_body"
)
type OLTPOutputConfig struct {
	ServiceAddress string `json:"service_address"` // default localhost:4317
	ClientAuthConfig
	Timeout     int               `json:"timeout"` // default 5s
	Compression string            `json:"compression"` // default none
	Headers     map[string]string `json:"headers"` // grpc headers
}

type ClientAuthConfig struct {
	TLSCA               string `json:"tls_ca"`
	TLSCert             string `json:"tls_cert"`
	TLSKey              string `json:"tls_key"`
	TLSKeyPwd           string `json:"tls_key_pwd"`
	TLSMinVersion       string `json:"tls_min_version"`
	InsecureSkipVerify  bool   `json:"insecure_skip_verify"`
	ServerName          string `json:"tls_server_name"`
	RenegotiationMethod string `json:"tls_renegotiation_method"`
	Enable              *bool  `json:"tls_enable"`
}

update GoVersion to 1.19, it's needed by opentelemetry, and 1.13 was too old, it's time to try new GO!

@childe
Copy link
Owner

childe commented Nov 1, 2023

Thanks very much for your PR, but according to my current plan, I'm not intending to add any more OUTPUTs. If you could provide a plugin-style codec & output, I'm pleased to add its link to Readme.

PS: refer to https://go.dev/ref/mod#go-mod-file-go:

The go directive sets the minimum version of Go required to use this module.

@codecov-commenter
Copy link

Codecov Report

Attention: 188 lines in your changes are missing coverage. Please review.

Comparison is base (5c04854) 32.62% compared to head (566c3ba) 31.96%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #234      +/-   ##
==========================================
- Coverage   32.62%   31.96%   -0.66%     
==========================================
  Files          53       55       +2     
  Lines        4377     4611     +234     
==========================================
+ Hits         1428     1474      +46     
- Misses       2794     2973     +179     
- Partials      155      164       +9     
Flag Coverage Δ
unittests 31.96% <19.65%> (-0.66%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
codec/oltp_encoder.go 0.00% <0.00%> (ø)
output/oltp_output.go 29.11% <29.11%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@evanzhang87
Copy link
Author

That's ok, learn from you!

@evanzhang87 evanzhang87 closed this Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants