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

exp: self instrumentation #981

Merged
merged 2 commits into from Mar 15, 2022
Merged

Conversation

rubenruizdegauna
Copy link
Contributor

No description provided.

Copy link
Contributor

@brushknight brushknight left a comment

Choose a reason for hiding this comment

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

Let's discuss a bit

.github/workflows/prerelease_linux.yml Outdated Show resolved Hide resolved
cmd/newrelic-infra/newrelic-infra.go Outdated Show resolved Hide resolved
internal/agent/agent.go Show resolved Hide resolved
internal/agent/event_sender.go Outdated Show resolved Hide resolved
@@ -320,14 +324,20 @@ func (sender *metricsIngestSender) sendBatches() {
select {

case batch := <-sender.batchQueue:
ctx := goContext.Background()
ctx, txn := instrumentation.SelfInstrumentation.StartTransaction(ctx, "sender.sendBatches")
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think to have one constants file with all transaction names listed there? Would be easier to modify namespace/subsystem/metric names

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm just thinking that we might want to have some dynamic (samples.sample, plugins.plugin ...) maybe we should wait until we have a list of what we want to report and then decide?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 with the idea of having a file for transactions/spans names. The dynamic ones could be generated of a constant prefix + dynamic name.

The file could also be used to know what are we instrumenting.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like the idea, it's just that I don't want to go too far this as this is just a POC. I'll create a doc to track this ideas/doubts and when it get's prioritised we can discuss these. wdyt?

t.nrSeg.End()
}

func NewAgentInstrumentationApm(license string, displayName string, apmEndpoint string, telemetryEndpoint string) (AgentInstrumentation, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What if the display name is not set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 In fact I'm not even sure if they would need to be different per host 🤷‍♂️ Or just send it within the metrics. I'll make a test to see how it looks in the UI and then change this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed it to const name independent of host/display name ... In the UI we can do this later. Let's see with canaries if we like it or not and after we will be able to take a better decision. wdty?

@rubenruizdegauna rubenruizdegauna force-pushed the exp/self_instrumentation branch 2 times, most recently from 4bdba79 to ff1b215 Compare February 21, 2022 15:02
brushknight
brushknight previously approved these changes Feb 22, 2022
Copy link
Contributor

@brushknight brushknight left a comment

Choose a reason for hiding this comment

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

LGTM

brushknight
brushknight previously approved these changes Mar 1, 2022
brushknight
brushknight previously approved these changes Mar 1, 2022
Copy link
Contributor

@brushknight brushknight left a comment

Choose a reason for hiding this comment

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

LGTM

@rubenruizdegauna rubenruizdegauna merged commit f3d5e2c into master Mar 15, 2022
@rubenruizdegauna rubenruizdegauna deleted the exp/self_instrumentation branch March 15, 2022 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants