signalfx-lambda 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -16
- data/lib/signalfx/lambda/metrics.rb +1 -1
- data/lib/signalfx/lambda/tracing.rb +7 -1
- data/lib/signalfx/lambda/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 604e6a08e998a28c3cdd7fee9fc19a4add9e3006d86ee6c4f1d4d99c4855a3da
|
4
|
+
data.tar.gz: a79b47dd337df68cd7ada68872e18eb5cb1405a0da2e7ace4872c7d0847a1ddc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d0154d033d918cd0db7c3ea74457e9bc346b38b75728945f8e8b4e53088416719864e2c94f46d550a5e85b093832ba8ffba4bfec73f9d149806c19f9253e795
|
7
|
+
data.tar.gz: '09ce944bdce4db331fa468d316dbcb447bc43c46eaa4bc50a8215d4c213af069992fb3bc4a4bcb886e86c545e3407d0f8cfbc2fd74e65d52cfd8f74e68af47d8'
|
data/README.md
CHANGED
@@ -57,10 +57,6 @@ SIGNALFX_ENDPOINT_URL=<gateway_url>
|
|
57
57
|
If the component-specific URLs below are set, they will take precedence over
|
58
58
|
`SIGNALFX_ENDPOINT_URL` for those components.
|
59
59
|
|
60
|
-
By default, the metrics and traces will be reported to the `us0` realm. If you are
|
61
|
-
not in this realm you will need to set the `SIGNALFX_TRACING_URL` and
|
62
|
-
`SIGNALFX_METRICS_URL` environment variables, as described below.
|
63
|
-
|
64
60
|
### Tracer configuration
|
65
61
|
|
66
62
|
The tracer used by the function is configured through environment variables:
|
@@ -76,12 +72,6 @@ When pointing to the Smart Gateway, an access token is not needed. When not
|
|
76
72
|
configured, the ingest URL defaults to `https://ingest.signalfx.com/v1/trace`,
|
77
73
|
which requires an access token to be configured.
|
78
74
|
|
79
|
-
The default `SIGNALFX_TRACING_URL` points to the `us0` realm. If you are not in
|
80
|
-
this realm, you will need to set the environment variable to the correct realm
|
81
|
-
ingest endpoint (https://ingest.{REALM}.signalfx.com/v1/trace). To determine what realm
|
82
|
-
you are in, check your profile page in the SignalFx web application (click the
|
83
|
-
avatar in the upper right and click My Profile).
|
84
|
-
|
85
75
|
The tracer will be persisted across invocations to the same context, reducing
|
86
76
|
the time needed for tracer initialization.
|
87
77
|
|
@@ -99,12 +89,6 @@ access token is not needed.
|
|
99
89
|
|
100
90
|
The metrics URL will default to `https://ingest.signalfx.com` when not configured.
|
101
91
|
|
102
|
-
The default `SIGNALFX_METRICS_URL` points to the `us0` realm. If you are not in
|
103
|
-
this realm, you will need to set the environment variable to the correct realm
|
104
|
-
ingest endpoint (https://ingest.{REALM}.signalfx.com). To determine what realm
|
105
|
-
you are in, check your profile page in the SignalFx web application (click the
|
106
|
-
avatar in the upper right and click My Profile).
|
107
|
-
|
108
92
|
## Trace and tags
|
109
93
|
|
110
94
|
The wrapper will generate a trace per function invocation. The parent span will
|
@@ -72,7 +72,7 @@ module SignalFx
|
|
72
72
|
dimensions = SignalFx::Lambda.fields.map do |key, val|
|
73
73
|
{ :key => key, :value => val }
|
74
74
|
end
|
75
|
-
dimensions.
|
75
|
+
dimensions.push({ :key => 'metric_source', :value => SignalFx::Lambda::COMPONENT })
|
76
76
|
end
|
77
77
|
|
78
78
|
def init_client
|
@@ -49,7 +49,7 @@ module SignalFx
|
|
49
49
|
|
50
50
|
def init_tracer(event)
|
51
51
|
access_token = ENV['SIGNALFX_ACCESS_TOKEN']
|
52
|
-
ingest_url =
|
52
|
+
ingest_url = get_ingest_url
|
53
53
|
service_name = ENV['SIGNALFX_SERVICE_NAME'] || event.function_name
|
54
54
|
@span_prefix = ENV['SIGNALFX_SPAN_PREFIX'] || 'lambda_ruby_'
|
55
55
|
|
@@ -77,6 +77,12 @@ module SignalFx
|
|
77
77
|
|
78
78
|
@tracer = OpenTracing.global_tracer
|
79
79
|
end
|
80
|
+
|
81
|
+
def get_ingest_url
|
82
|
+
return ENV['SIGNALFX_TRACING_URL'] if ENV.key? 'SIGNALFX_TRACING_URL'
|
83
|
+
return ENV['SIGNALFX_ENDPOINT_URL'] + '/v1/trace' if ENV.key? 'SIGNALFX_ENDPOINT_URL'
|
84
|
+
return 'https://ingest.signalfx.com/v1/trace'
|
85
|
+
end
|
80
86
|
end
|
81
87
|
end
|
82
88
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: signalfx-lambda
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ashwin Chandrasekar
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jaeger-client
|