Skip to content

Commit 9cb8367

Browse files
authored
EA Telemetry: Include source EA name in composite EA response (#3506)
* Include source EA name in composite EA response * add changeset * update l2se ea name * remove try catch
1 parent 4e49d3e commit 9cb8367

File tree

5 files changed

+30
-4
lines changed

5 files changed

+30
-4
lines changed

.changeset/gold-zebras-tan.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@chainlink/crypto-volatility-index-adapter': minor
3+
'@chainlink/anyblock-adapter': minor
4+
'@chainlink/ea-bootstrap': minor
5+
---
6+
7+
Include source EA name in composite EA response.
8+
9+
Also updates CVI, BLOCKDAEMON and L2_SEQUENCER_HEALTH EA names for telemetry compatibility reasons.

packages/composites/crypto-volatility-index/src/config/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Requester } from '@chainlink/ea-bootstrap'
22
import { Config } from '@chainlink/ea-bootstrap'
33

44
export const DEFAULT_NETWORK = 'ETHEREUM'
5-
export const NAME = 'CRYPTO_VOLATILITY_INDEX'
5+
export const NAME = 'CVI'
66
export const DEFAULT_ENDPOINT = 'volatilityIndex'
77

88
export const makeConfig = (prefix?: string): Config => {

packages/core/bootstrap/src/lib/metrics/index.ts

+18-1
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,26 @@ export const withMetrics =
7474
? HttpRequestType.CACHE_HIT
7575
: HttpRequestType.DATA_PROVIDER_HIT,
7676
})
77+
78+
let sourceString
79+
if (
80+
input?.data?.source &&
81+
typeof input?.data?.source === 'string' &&
82+
input?.data?.source !== ''
83+
) {
84+
const sourceName = input?.data?.source
85+
sourceString = '?SOURCE=' + sourceName.toUpperCase()
86+
}
87+
88+
let adapterNameStr = context.name
89+
90+
if (sourceString && adapterNameStr) {
91+
adapterNameStr = context.name + sourceString
92+
}
93+
7794
return {
7895
...result,
79-
meta: { adapterName: context.name },
96+
meta: { adapterName: adapterNameStr },
8097
metricsMeta: { ...result.metricsMeta, ...metricsMeta },
8198
}
8299
} catch (e: any) {

packages/sources/anyblock/src/config/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Requester } from '@chainlink/ea-bootstrap'
22
import { Config } from '@chainlink/ea-bootstrap'
33

44
export const DEFAULT_BASE_URL = 'https://svc.blockdaemon.com'
5-
export const NAME = 'BLOCKDAEMON'
5+
export const NAME = 'ANYBLOCK'
66

77
export const DEFAULT_ENDPOINT = 'gasprice'
88

packages/sources/layer2-sequencer-health/src/config/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { AdapterContext, Config } from '@chainlink/ea-bootstrap'
33
import { envDefaultOverrides } from './envDefaultOverrides'
44
import { RpcProvider } from 'starknet'
55

6-
export const NAME = 'L2_SEQUENCER_HEALTH'
6+
export const NAME = 'LAYER2_SEQUENCER_HEALTH'
77
export const DEFAULT_PRIVATE_KEY =
88
'0x0000000000000000000000000000000000000000000000000000000000000001'
99

0 commit comments

Comments
 (0)