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

SC-20508 Add sematext exporter #2

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open

Conversation

Eromosele-SM
Copy link
Collaborator

@Eromosele-SM Eromosele-SM commented Oct 7, 2024

This PR adds metrics support for Sematext exporter

@Eromosele-SM Eromosele-SM marked this pull request as ready for review October 8, 2024 21:56
@otisg
Copy link
Member

otisg commented Oct 9, 2024

@Eromosele-SM "This branch has conflicts that must be resolved"

exporter/sematextexporter/config.go Outdated Show resolved Hide resolved
cmd/otelcontribcol/go.mod Outdated Show resolved Hide resolved
exporter/sematextexporter/Makefile Outdated Show resolved Hide resolved
exporter/sematextexporter/config.go Outdated Show resolved Hide resolved
exporter/sematextexporter/config.go Show resolved Hide resolved
exporter/sematextexporter/writer.go Show resolved Hide resolved
exporter/sematextexporter/writer.go Outdated Show resolved Hide resolved
exporter/sematextexporter/writer.go Outdated Show resolved Hide resolved
exporter/sematextexporter/writer_test.go Outdated Show resolved Hide resolved
exporter/sematextexporter/writer_test.go Show resolved Hide resolved
@otisg
Copy link
Member

otisg commented Oct 9, 2024

FWIW I saw 2 instances of the following in your merge of main into your fork:
c64a75e [chore] [exporter/sumologic] Use NewDefaultClientConfig instead of manually creating struct (open-telemetry#35547)

(this one for SL, and another for Mezmo)
Maybe something new to look into/use?

@Eromosele-SM
Copy link
Collaborator Author

FWIW I saw 2 instances of the following in your merge of main into your fork: c64a75e [chore] [exporter/sumologic] Use NewDefaultClientConfig instead of manually creating struct (open-telemetry#35547)

(this one for SL, and another for Mezmo) Maybe something new to look into/use?

Their createDefaultClientConfig() function returns a confighttp.ClientConfig but what our createDefaultClientConfig() function returns is a component.Config and there is no default for it

Copy link

@jackgopack4 jackgopack4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any major issues here, some small suggestions. Make sure you get some pipelines/checks set up (you may be able to piggyback on upstream CI if you open a draft PR on open-telemetry/opentelemetry-collector-contrib

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no specific comments on any of your tests, but it might be useful to open up a draft pr on the contrib repo to benefit from their pipelines they have set up for linting, test coverage, etc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah i will, once i am done with the logs support

exporter/sematextexporter/writer_test.go Outdated Show resolved Hide resolved
@Eromosele-SM Eromosele-SM changed the title Add sematext exporter SC:20508 Add sematext exporter Oct 14, 2024
* `endpoint` (required) HTTP/S destination for metric receivers. It is dependent on the region:
- US: `spm-receiver.sematext.com`
- EU: `spm-receiver.eu.sematext.com`
* `timeout` (default = 5s) Timeout for requests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Eromosele-SM make it match STA timeout?

* `US`
* `EU`
* `payload_max_lines` (default = 10_000) Maximum number of lines allowed per HTTP POST request
* `payload_max_bytes` (default = 10_000_000) Maximum number of bytes allowed per HTTP POST request
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Eromosele-SM I'd check these defaults internally with Sematext first.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the suggest for custom metrics. I'd ask STA devs what STA uses.

* `payload_max_bytes` (default = 10_000_000) Maximum number of bytes allowed per HTTP POST request
* `metrics_schema` (default = telegraf-prometheus-v2) The chosen metrics schema to write; must be one of:
* `otel-v1`
* `telegraf-prometheus-v2`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Eromosele-SM probably only one schema in the end. Also, this Exporter will end up shipping telemetry other than metrics. So maybe you want to structure the README in preparation for that. For example, this particular schema will be only for metrics.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can always edit the readme when we have logs support ready?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ofc. I hope the YAML is also structured in anticipation of Exporter sending other telemetry later (so other App tokens, other endpoints, although the region could probably remain general).

Copy link
Member

@otisg otisg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few suggestions made...

@Eromosele-SM
Copy link
Collaborator Author

@boratanrikulu @otisg
Can you please take a look?
I made some changes

Copy link
Member

@otisg otisg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just did a quick skip over the surface stuff, not actual code.

exporter/sematextexporter/README.md Outdated Show resolved Hide resolved
exporter/sematextexporter/config.go Outdated Show resolved Hide resolved

// Validate checks for invalid or missing entries in the configuration.
func (cfg *Config) Validate() error {
if strings.ToLower(cfg.Region) != "eu" && strings.ToLower(cfg.Region) != "us" && strings.ToLower(cfg.Region) != "custom"{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not sure what "custom" is for. Esp. since in the line below you say only US and EU are allowed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The custom is so that we can run tests on the exporter with a mockserver

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.

5 participants