Giter Club home page Giter Club logo

apm-agent-go's Introduction

Build Status PkgGoDev Go Report Card codecov.io

NOTE: This repository is in maintenance mode. Bug fixes will continue to be applied, but no new features will be implemented. To replace this agent, we recommend you to migrate to the OpenTelemetry Go API and SDK, which provides similar features. In order to help you do a seamless migration, we recommend using our OpenTelemetry Bridge. Please refer to the blog post above for further details.

apm-agent-go: APM Agent for Go

This is the official Go package for Elastic APM.

The Go agent enables you to trace the execution of operations in your application, sending performance metrics and errors to the Elastic APM server.

Installation

Within a Go module:

go get go.elastic.co/apm/v2

Requirements

Requires APM Server v6.5 or newer.

You can find a list of the supported frameworks and other technologies in the documentation.

License

Apache 2.0.

Documentation

Elastic APM Go documentation.

Getting Help

If you find a bug, please report an issue. For any other assistance, please open or add to a topic on the APM discuss forum.

apm-agent-go's People

Contributors

alexanderwert avatar apmmachine avatar axw avatar bmorelli25 avatar cachedout avatar carsonip avatar dependabot[bot] avatar dmathieu avatar graphaelli avatar gvencadze avatar jacksehr avatar jalvz avatar jcchavezs avatar kruskall avatar kuisathaverat avatar lahsivjar avatar luqmansen avatar macnibblet avatar marclop avatar mdelapenya avatar pebrc avatar psrebniak avatar reakaleek avatar rliebz avatar ryanhallcs avatar shubhamsharma7867 avatar simitt avatar skynet2 avatar stuartnelson3 avatar v1v avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apm-agent-go's Issues

Capture span stack frames when time exceeds configurable threshold

We currently never capture stack frames for spans, because it's too expensive. We should follow other agents (at least the Java agent does it), and provide a configurable span duration threshold which, when reached, will cause the span's stack frames to be captured.

Add ELASTIC_APM_ACTIVE config

We should support ELASTIC_APM_ACTIVE, and add pair of methods to Tracer to control and report whether tracing is active. Modules should check this and avoid any overhead when the tracer is inactive.

Add vgo module(s)

vgo is a new proposed package versioning mechanism for Go. It's going to be included in Go 1.11 as an opt-in feature. We should look at including modules to support its use.

contrib: rename to "mod", apply functional options consistently

Rename from "contrib" to "mod" (short for "module", a la apache), and update middleware constructors to accept options rather than positional arguments where those parameters are optional (e.g. provide WithTracer rather than taking a *Tracer where nil means to use the default.)

Support toggling tracer activity

You can now enable or disable the tracer with the environment variable ELASTIC_APM_ACTIVE. We should consider supporting dynamically toggling on/off at runtime.

Add support for describing the application framework

I'm currently removing the ability for specifying the framework in transaction payloads, because Go's web frameworks tend to be less exclusive of each other. i.e. you could have two web frameworks in the same application. When we can attach the framework info to the transaction, then we'll reinstate support.

This requires changes to the API and API server.

Add support for metrics API

The APM server will be introducing a new API for accepting application metrics. Update the agent code to support the API, along with bridges for popular metrics libraries (Prometheus, go-metrics). Also provide builtin metrics, e.g. heap usage, CPU usage, GC timings.

PR: #94

Rename {Span,Transaction}.Done to End, drop duration

The other APM agents call it "end", rather than "done". We will follow suit.

Also, we'll drop the time.Duration parameter from those methods, since in most cases developers will want to have Done/End calculate the duration. Instead, expose a Duration field on the types.

Redact headers, cookies, form fields

We should redact header/cookie/form values with keys matching some patterns (e.g. "secret", "password", etc.), or values matching some patterns (e.g. credit card or social security numbers). The patterns should also be extensible via environment variables.

module/apmsql: wrap returned sql.Tx

We're not currently wrapping the sql.Tx returned from BeginTx. By wrapping the returned Tx, we can observe how much time is spent beginning and committing/rolling back database transactions.

Rename Span.Start to Span.Timestamp

In the intake API it's called start, but that's an offset from the transaction's timestamp. We should call the field Timestamp for consistency with the Transaction type, to tidy up the API.

Add changelog

We should introduce a changelog, incorporated into the elastic.co docs

Revisit default ELASTIC_APM_SERVER_URL

All of the other agents have a default value of http://localhost:8200 for ELASTIC_APM_SERVER_URL, to simplify development/getting started. The Go agent currently has no default, and disables the transport if no URL is set. We should consider changing to be consistent.

apmgin: record duration to end of middleware

We should report the entire time, including the middleware. That's the time that the user cares about.

We might also include a transaction mark that identifies the point at which the underlying handler completed, but it's unlikely to be significant overhead generally, so probably not that useful.

Add CPU metrics

We should include process (and host?) CPU usage as part of the builtin metrics we report to APM server. Probably use elastic/gosigar.

Trim URLs, etc. above 1024 byte limit

If URLs in any transaction are longer than 1024 bytes, the APM server will reject the entire payload. We need to make sure that fields with limited lengths are trimmed.

module/apmhttprouter: provide Router wrapper

Add a Router type to apmhttprouter, along with a New method. The Router type will embed httprouter.Router but will shadow the route-adding methods, wrapping handlers on the way in.

Provide stable API for setting context, etc.

The elasticapm.Transaction, Span, and Error types currently expose the underlying model types of the same name. This will pose a problem if/when the model changes. Instead of exposing those types directly, we should provide a stable API for adding context, setting error details, etc.

  • elasticapm.Error
  • elasticapm.Transaction
  • elasticapm.Span
  • introduce elasticapm.Context type/methods
  • introduce stacktrace.Frame

elasticapm.Tracer.Service For now we'll continue to expose model.Service, as it's relatively simple and unlikely to change significantly, and we don't anticipate that modifying it will be a common thing anyway.

Expose Transaction.Name and Span.Name

Assuming we're going to support OpenTracing, we'll need to be able to change the transaction or span's name after it has been started. This is necessary because OpenTracing's Span API includes a method for setting/changing the operation name.

Assuming we do that, there's a follow-on issue: we currently filter on transaction name (ELASTIC_APM_TRANSACTION_IGNORE_NAMES) when starting a transaction. Transactions with a matching name will be ignored. We can either not support that configuration for updated operation names, or perform an additional check when the transaction is ended.

Compress payloads

The APM server supports deflate and gzip compression. The Go agent should transparently gzip payloads that go over a given uncompressed size.

Fuzz-test the API

Fuzz-test the API to give some confidence that we prevent the sending of invalid payloads to the APM server.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.