Giter Club home page Giter Club logo

stackimpact / stackimpact-go Goto Github PK

View Code? Open in Web Editor NEW
290.0 290.0 36.0 299 KB

DEPRECATED StackImpact Go Profiler - Production-Grade Performance Profiler: CPU, memory allocations, blocking calls, errors, metrics, and more

Home Page: https://stackimpact.com

License: Other

Go 100.00%
agent cpu-profiling go golang hot-spot-profiles memory-leak-detection memory-profiler monitor-performance monitoring performance-analysis performance-metrics performance-tuning pprof profiler profiling-library tracing

stackimpact-go's People

Contributors

dmelikyan 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

stackimpact-go's Issues

Don't see stackimpact.Options() and

I am using one agent and I can see the updates in the dashboard. I can use the following APIs:

agent := stackimpact.NewAgent()
agent.Configure("key", "MyGoApp")

But I am not able to use other APIs as mentioned in the examples such as:

stackimpact.Options() or agent.Start()

segment := agent.MeasureSegment("Segment1")
defer segment.Stop()

subsegment := agent.MeasureSubsegment("Segment1", "Subsegment1")
defer subsegment.Stop()

what do you mean "DEPRECATED" ?

DEPRECATED StackImpact Go Profiler - Production-Grade Performance Profiler: CPU, memory allocations, blocking calls, errors, metrics, and more

App Engine support

Hey guys,
I was looking into this and noticed that doesn’t seem to be App Engine compatible. On App Engine:

  1. the syscall library isn’t available.
  2. the standard HTTP client isn’t available, but requests can create and provide one while active using their context. — See here, for example: https://github.com/stripe/stripe-go#google-appengine

Is it possible that support could be added? There are a lot of Go applications running on App Engine.

Replacement

Was there a decent alternative to this at all?

The StackImpact dashboard was totally perfect and I've not seen anything match it for Go applications anywhere else.

Anyone find anything?

Memory leaks

I had added stackimpact to my program just to find where I have memory leaks
but unfortunately I experienced more memory leaks as before adding stackimpact.

There is only one of leak that I have screenshoted (I have watched few different points):

ROUTINE ======================== github.com/stackimpact/stackimpact-go/internal.(*APIRequest).post in /home/go/.gvm/pkgsets/go1.7/global/src/git
hub.com/stackimpact/stackimpact-go/internal/api_request.go
  512.14kB   478.35MB (flat, cum) 13.72% of Total
         .          .     24:   return ar
         .          .     25:}
         .          .     26:
         .          .     27:func (ar *APIRequest) post(endpoint string, payload map[string]interface{}) (map[string]interface{}, error) {
         .          .     28:   reqBody := map[string]interface{}{
  512.14kB   512.14kB     29:           "runtime_type":    "go",
         .          .     30:           "runtime_version": runtime.Version(),
         .          .     31:           "agent_version":   AgentVersion,
         .          .     32:           "app_name":        ar.agent.AppName,
         .          .     33:           "app_version":     ar.agent.AppVersion,
         .          .     34:           "app_environment": ar.agent.AppEnvironment,
         .          .     35:           "host_name":       ar.agent.HostName,
         .          .     36:           "build_id":        ar.agent.buildId,
         .          .     37:           "run_id":          ar.agent.runId,
         .          .     38:           "run_ts":          ar.agent.runTs,
         .          .     39:           "sent_at":         time.Now().Unix(),
         .     8.02MB     40:           "payload":         payload,
         .          .     41:   }
         .          .     42:
         .          .     43:   reqBodyJson, _ := json.Marshal(reqBody)
         .          .     44:
         .   469.83MB     45:   var buf bytes.Buffer
         .          .     46:   w := gzip.NewWriter(&buf)
         .          .     47:   w.Write(reqBodyJson)
         .          .     48:   w.Close()
         .          .     49:
         .          .     50:   url := ar.agent.DashboardAddress + "/agent/v1/" + endpoint

So I have removed stackimpact and memory leaks decreased significally

Race in stackimpact

Running 2.0.1.

==================
==================
WARNING: DATA RACE
Read at 0x00c420694000 by goroutine 199:
  math/rand.(*rngSource).Int63()
      /usr/local/Cellar/go/1.8.3/libexec/src/math/rand/rng.go:231 +0x3f
  math/rand.(*Rand).Int63()
      /usr/local/Cellar/go/1.8.3/libexec/src/math/rand/rand.go:81 +0x51
  math/rand.(*Rand).Int31()
      /usr/local/Cellar/go/1.8.3/libexec/src/math/rand/rand.go:95 +0x38
  math/rand.(*Rand).Int31n()
      /usr/local/Cellar/go/1.8.3/libexec/src/math/rand/rand.go:130 +0x62
  math/rand.(*Rand).Intn()
      /usr/local/Cellar/go/1.8.3/libexec/src/math/rand/rand.go:144 +0x52
  <company>/vendor/github.com/stackimpact/stackimpact-go/internal.(*Agent).uuid()
      <company>/vendor/github.com/stackimpact/stackimpact-go/internal/agent.go:247 +0xd9
  <company>/vendor/github.com/stackimpact/stackimpact-go/internal.(*Metric).createMeasurement()
      <company>/vendor/github.com/stackimpact/stackimpact-go/internal/metric.go:388 +0xbb
  <company>/vendor/github.com/stackimpact/stackimpact-go/internal.(*CPUReporter).report()
      <company>/vendor/github.com/stackimpact/stackimpact-go/internal/cpu_reporter.go:209 +0x3bf
  <company>/vendor/github.com/stackimpact/stackimpact-go/internal.(*CPUReporter).start.func2()
      <company>/vendor/github.com/stackimpact/stackimpact-go/internal/cpu_reporter.go:88 +0x41
  <company>/vendor/github.com/stackimpact/stackimpact-go/internal.NewTimer.func1.1()
      <company>/vendor/github.com/stackimpact/stackimpact-go/internal/agent.go:308 +0x150

Previous write at 0x00c420694000 by goroutine 79:
  math/rand.(*rngSource).Int63()
      /usr/local/Cellar/go/1.8.3/libexec/src/math/rand/rng.go:231 +0x58
  math/rand.(*Rand).Int63()
      /usr/local/Cellar/go/1.8.3/libexec/src/math/rand/rand.go:81 +0x51
  math/rand.(*Rand).Int31()
      /usr/local/Cellar/go/1.8.3/libexec/src/math/rand/rand.go:95 +0x38
  math/rand.(*Rand).Int31n()
      /usr/local/Cellar/go/1.8.3/libexec/src/math/rand/rand.go:130 +0x62
  math/rand.(*Rand).Intn()
      /usr/local/Cellar/go/1.8.3/libexec/src/math/rand/rand.go:144 +0x52
  <company>/vendor/github.com/stackimpact/stackimpact-go/internal.(*Agent).uuid()
      <company>/vendor/github.com/stackimpact/stackimpact-go/internal/agent.go:247 +0xd9
  <company>/vendor/github.com/stackimpact/stackimpact-go/internal.(*Metric).createMeasurement()
      <company>/vendor/github.com/stackimpact/stackimpact-go/internal/metric.go:388 +0xbb
  <company>/vendor/github.com/stackimpact/stackimpact-go/internal.(*ProcessReporter).reportMetric()
      <company>/vendor/github.com/stackimpact/stackimpact-go/internal/process_reporter.go:72 +0x181
  <company>/vendor/github.com/stackimpact/stackimpact-go/internal.(*ProcessReporter).report()
      <company>/vendor/github.com/stackimpact/stackimpact-go/internal/process_reporter.go:136 +0x98d
  <company>/vendor/github.com/stackimpact/stackimpact-go/internal.(*ProcessReporter).start.func1()
      <company>/vendor/github.com/stackimpact/stackimpact-go/internal/process_reporter.go:48 +0x41
  <company>/vendor/github.com/stackimpact/stackimpact-go/internal.NewTimer.func1.1()
      <company>/vendor/github.com/stackimpact/stackimpact-go/internal/agent.go:308 +0x150

Goroutine 199 (running) created at:
  <company>/vendor/github.com/stackimpact/stackimpact-go/internal.NewTimer.func1()
      <company>/vendor/github.com/stackimpact/stackimpact-go/internal/agent.go:313 +0x267

Goroutine 79 (running) created at:
  <company>/vendor/github.com/stackimpact/stackimpact-go/internal.NewTimer.func1()
      <company>/vendor/github.com/stackimpact/stackimpact-go/internal/agent.go:313 +0x267
==================```

agent not working inside a container

I have a simple application using stackimpact agent for testing, but it can't work when I run this app inside a container.
I found that the api address is agent-api.stackimpact.com and I usetcpdump to capture the packets but they are all encrypted, but I did see the traffic.

That's the simple program:

package main

import (
	"fmt"
	"net/http"

	"github.com/stackimpact/stackimpact-go"
)

func handler(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintf(w, "Hello world!")
}

func main() {
	go func() {
		agent := stackimpact.Start(stackimpact.Options{
			AgentKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
			AppName:  "hello-world-00",
		})
		span := agent.Profile()
		defer span.Stop()
	}()

	http.HandleFunc("/", handler)
	http.ListenAndServe(":8077", nil)
}

Is there anything I missed?

image

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.