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

fix monitoring-beats-mb template #83160

Merged
merged 1 commit into from
Jan 26, 2022

Conversation

klacabane
Copy link
Contributor

@klacabane klacabane commented Jan 26, 2022

Summary

Context elastic/apm-server#7139

Moves the beats_stats.apm-server mapping section under the beats_stats.metrics property as expected by Stack Monitoring.

Testing

  • start local elasticsearch with updated mappings
  • install apm integration assets
  • start apm-server
  • ingest some data to the APM Server, run this Go program[1] a few times (Export the ELASTIC_APM_SERVER_URL environment variable)
  • verify Stack monitoring's Apm server graphs are populated[2]

[1]

package main

import (
	"context"
	"fmt"
	"os"
	"time"

	"go.elastic.co/apm"
)

func main() {
	version := "undefined"
	if len(os.Args) > 1 {
		version = os.Args[1]
	}
	name := fmt.Sprintf("apm-server-%s", version)
	// apm.DefaultTracer.SetSampler(apm.NewRatioSampler(0.0))

	for i := 0; i < 1000; i++ {
		tx := apm.DefaultTracer.StartTransaction(name, "type")
		ctx := apm.ContextWithTransaction(context.Background(), tx)
		span, ctx := apm.StartSpan(ctx, name, "type")
		span.Duration = time.Second
		span.End()
		tx.Duration = 2 * time.Second
		tx.End()
		<-time.After(time.Millisecond)
	}
	<-time.After(time.Second)
	apm.DefaultTracer.Flush(nil)
	fmt.Printf("%s: %+v\n", name, apm.DefaultTracer.Stats())
}

[2]
Screenshot 2022-01-26 at 17 04 32

@elasticsearchmachine elasticsearchmachine added v8.1.0 external-contributor Pull request authored by a developer outside the Elasticsearch team labels Jan 26, 2022
@klacabane klacabane self-assigned this Jan 26, 2022
@klacabane klacabane added :Data Management/Monitoring auto-backport Automatically create backport pull requests when merged v8.0.0 labels Jan 26, 2022
@klacabane klacabane marked this pull request as ready for review January 26, 2022 16:26
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Jan 26, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@klacabane klacabane added the >bug label Jan 26, 2022
Copy link
Contributor

@jakelandis jakelandis left a comment

Choose a reason for hiding this comment

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

LGTM.

@klacabane klacabane merged commit 563cb9e into elastic:master Jan 26, 2022
@klacabane
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.0

Questions ?

Please refer to the Backport tool documentation

klacabane added a commit to klacabane/elasticsearch that referenced this pull request Jan 26, 2022
marclop pushed a commit that referenced this pull request Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged >bug :Data Management/Monitoring external-contributor Pull request authored by a developer outside the Elasticsearch team Team:Data Management Meta label for data/management team v8.0.0 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants