mirror of
https://github.com/SigNoz/signoz.git
synced 2026-06-26 01:50:31 +01:00
Compare commits
3 Commits
nv/schema-
...
fix/remove
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f7d74113f | ||
|
|
853397a79e | ||
|
|
bd526df11d |
11
.github/workflows/jsci.yaml
vendored
11
.github/workflows/jsci.yaml
vendored
@@ -56,17 +56,6 @@ jobs:
|
||||
PRIMUS_REF: main
|
||||
JS_SRC: frontend
|
||||
JS_PKG_MANAGER: pnpm
|
||||
languages:
|
||||
if: |
|
||||
github.event_name == 'merge_group' ||
|
||||
(github.event_name == 'pull_request' && ! github.event.pull_request.head.repo.fork && github.event.pull_request.user.login != 'dependabot[bot]' && ! contains(github.event.pull_request.labels.*.name, 'safe-to-test')) ||
|
||||
(github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'safe-to-test'))
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: self-checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: run
|
||||
run: bash frontend/scripts/validate-md-languages.sh
|
||||
openapi:
|
||||
if: |
|
||||
github.event_name == 'merge_group' ||
|
||||
|
||||
@@ -2553,6 +2553,17 @@ components:
|
||||
url:
|
||||
type: string
|
||||
type: object
|
||||
DashboardTextVariableSpec:
|
||||
properties:
|
||||
constant:
|
||||
type: boolean
|
||||
display:
|
||||
$ref: '#/components/schemas/VariableDisplay'
|
||||
name:
|
||||
type: string
|
||||
value:
|
||||
type: string
|
||||
type: object
|
||||
DashboardtypesAxes:
|
||||
properties:
|
||||
isLogScale:
|
||||
@@ -2734,23 +2745,24 @@ components:
|
||||
DashboardtypesDatasourcePlugin:
|
||||
discriminator:
|
||||
mapping:
|
||||
signoz/Datasource: '#/components/schemas/DashboardtypesDatasourcePluginVariantGithubComSigNozSignozPkgTypesDashboardtypesSigNozDatasourceSpec'
|
||||
signoz/Datasource: '#/components/schemas/DashboardtypesDatasourcePluginVariantStruct'
|
||||
propertyName: kind
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/DashboardtypesDatasourcePluginVariantGithubComSigNozSignozPkgTypesDashboardtypesSigNozDatasourceSpec'
|
||||
- $ref: '#/components/schemas/DashboardtypesDatasourcePluginVariantStruct'
|
||||
type: object
|
||||
DashboardtypesDatasourcePluginKind:
|
||||
enum:
|
||||
- signoz/Datasource
|
||||
type: string
|
||||
DashboardtypesDatasourcePluginVariantGithubComSigNozSignozPkgTypesDashboardtypesSigNozDatasourceSpec:
|
||||
DashboardtypesDatasourcePluginVariantStruct:
|
||||
properties:
|
||||
kind:
|
||||
enum:
|
||||
- signoz/Datasource
|
||||
type: string
|
||||
spec:
|
||||
$ref: '#/components/schemas/DashboardtypesSigNozDatasourceSpec'
|
||||
nullable: true
|
||||
type: object
|
||||
required:
|
||||
- kind
|
||||
- spec
|
||||
@@ -2916,15 +2928,9 @@ components:
|
||||
type: string
|
||||
nullable: true
|
||||
type: object
|
||||
mode:
|
||||
$ref: '#/components/schemas/DashboardtypesLegendMode'
|
||||
position:
|
||||
$ref: '#/components/schemas/DashboardtypesLegendPosition'
|
||||
type: object
|
||||
DashboardtypesLegendMode:
|
||||
enum:
|
||||
- list
|
||||
type: string
|
||||
DashboardtypesLegendPosition:
|
||||
enum:
|
||||
- bottom
|
||||
@@ -2971,34 +2977,19 @@ components:
|
||||
customAllValue:
|
||||
type: string
|
||||
defaultValue:
|
||||
oneOf:
|
||||
- type: string
|
||||
- items:
|
||||
type: string
|
||||
type: array
|
||||
$ref: '#/components/schemas/VariableDefaultValue'
|
||||
display:
|
||||
$ref: '#/components/schemas/DashboardtypesDisplay'
|
||||
name:
|
||||
minLength: 1
|
||||
type: string
|
||||
plugin:
|
||||
$ref: '#/components/schemas/DashboardtypesVariablePlugin'
|
||||
sort:
|
||||
$ref: '#/components/schemas/DashboardtypesListVariableSpecSort'
|
||||
nullable: true
|
||||
type: string
|
||||
required:
|
||||
- display
|
||||
- name
|
||||
type: object
|
||||
DashboardtypesListVariableSpecSort:
|
||||
enum:
|
||||
- none
|
||||
- alphabetical-asc
|
||||
- alphabetical-desc
|
||||
- numerical-asc
|
||||
- numerical-desc
|
||||
- alphabetical-ci-asc
|
||||
- alphabetical-ci-desc
|
||||
type: string
|
||||
DashboardtypesListableDashboardForUserV2:
|
||||
properties:
|
||||
dashboards:
|
||||
@@ -3296,6 +3287,7 @@ components:
|
||||
queries:
|
||||
items:
|
||||
$ref: '#/components/schemas/DashboardtypesQuery'
|
||||
nullable: true
|
||||
type: array
|
||||
required:
|
||||
- display
|
||||
@@ -3498,8 +3490,6 @@ components:
|
||||
required:
|
||||
- queryValue
|
||||
type: object
|
||||
DashboardtypesSigNozDatasourceSpec:
|
||||
type: object
|
||||
DashboardtypesSource:
|
||||
enum:
|
||||
- user
|
||||
@@ -3509,13 +3499,8 @@ components:
|
||||
DashboardtypesSpanGaps:
|
||||
properties:
|
||||
fillLessThan:
|
||||
description: The maximum gap size to connect when fillOnlyBelow is true.
|
||||
Gaps larger than this duration are left disconnected.
|
||||
type: string
|
||||
fillOnlyBelow:
|
||||
description: Controls whether lines connect across null values. When false
|
||||
(default), all gaps are connected. When true, only gaps smaller than fillLessThan
|
||||
are connected.
|
||||
type: boolean
|
||||
type: object
|
||||
DashboardtypesStorableDashboardData:
|
||||
@@ -3563,22 +3548,6 @@ components:
|
||||
- color
|
||||
- columnName
|
||||
type: object
|
||||
DashboardtypesTextVariableSpec:
|
||||
properties:
|
||||
constant:
|
||||
type: boolean
|
||||
display:
|
||||
$ref: '#/components/schemas/DashboardtypesDisplay'
|
||||
name:
|
||||
minLength: 1
|
||||
type: string
|
||||
value:
|
||||
type: string
|
||||
required:
|
||||
- display
|
||||
- value
|
||||
- name
|
||||
type: object
|
||||
DashboardtypesThresholdFormat:
|
||||
enum:
|
||||
- text
|
||||
@@ -3598,6 +3567,7 @@ components:
|
||||
required:
|
||||
- value
|
||||
- color
|
||||
- label
|
||||
type: object
|
||||
DashboardtypesTimePreference:
|
||||
enum:
|
||||
@@ -3682,11 +3652,23 @@ components:
|
||||
discriminator:
|
||||
mapping:
|
||||
ListVariable: '#/components/schemas/DashboardtypesVariableEnvelopeGithubComSigNozSignozPkgTypesDashboardtypesListVariableSpec'
|
||||
TextVariable: '#/components/schemas/DashboardtypesVariableEnvelopeGithubComSigNozSignozPkgTypesDashboardtypesTextVariableSpec'
|
||||
TextVariable: '#/components/schemas/DashboardtypesVariableEnvelopeGithubComPersesSpecGoDashboardTextVariableSpec'
|
||||
propertyName: kind
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/DashboardtypesVariableEnvelopeGithubComSigNozSignozPkgTypesDashboardtypesListVariableSpec'
|
||||
- $ref: '#/components/schemas/DashboardtypesVariableEnvelopeGithubComSigNozSignozPkgTypesDashboardtypesTextVariableSpec'
|
||||
- $ref: '#/components/schemas/DashboardtypesVariableEnvelopeGithubComPersesSpecGoDashboardTextVariableSpec'
|
||||
type: object
|
||||
DashboardtypesVariableEnvelopeGithubComPersesSpecGoDashboardTextVariableSpec:
|
||||
properties:
|
||||
kind:
|
||||
enum:
|
||||
- TextVariable
|
||||
type: string
|
||||
spec:
|
||||
$ref: '#/components/schemas/DashboardTextVariableSpec'
|
||||
required:
|
||||
- kind
|
||||
- spec
|
||||
type: object
|
||||
DashboardtypesVariableEnvelopeGithubComSigNozSignozPkgTypesDashboardtypesListVariableSpec:
|
||||
properties:
|
||||
@@ -3700,18 +3682,6 @@ components:
|
||||
- kind
|
||||
- spec
|
||||
type: object
|
||||
DashboardtypesVariableEnvelopeGithubComSigNozSignozPkgTypesDashboardtypesTextVariableSpec:
|
||||
properties:
|
||||
kind:
|
||||
enum:
|
||||
- TextVariable
|
||||
type: string
|
||||
spec:
|
||||
$ref: '#/components/schemas/DashboardtypesTextVariableSpec'
|
||||
required:
|
||||
- kind
|
||||
- spec
|
||||
type: object
|
||||
DashboardtypesVariablePlugin:
|
||||
discriminator:
|
||||
mapping:
|
||||
@@ -7896,6 +7866,15 @@ components:
|
||||
type: object
|
||||
VariableDefaultValue:
|
||||
type: object
|
||||
VariableDisplay:
|
||||
properties:
|
||||
description:
|
||||
type: string
|
||||
hidden:
|
||||
type: boolean
|
||||
name:
|
||||
type: string
|
||||
type: object
|
||||
ZeustypesGettableHost:
|
||||
properties:
|
||||
hosts:
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
"logs_to_metrics": "Logs To Metrics",
|
||||
"roles": "Roles",
|
||||
"role_details": "Role Details",
|
||||
"role_edit": "Edit Role",
|
||||
"role_create": "Create Role",
|
||||
"members": "Members",
|
||||
"service_accounts": "Service Accounts",
|
||||
"mcp_server": "MCP Server"
|
||||
|
||||
@@ -82,6 +82,8 @@
|
||||
"TRACE_DETAIL_OLD": "SigNoz | Trace Detail",
|
||||
"SERVICE_TOP_LEVEL_OPERATIONS": "SigNoz | Service Operations",
|
||||
"ROLE_DETAILS": "SigNoz | Role Details",
|
||||
"ROLE_CREATE": "SigNoz | Create Role",
|
||||
"ROLE_EDIT": "SigNoz | Edit Role",
|
||||
"TRACES_FUNNELS_DETAIL": "SigNoz | Funnel",
|
||||
"INTEGRATIONS_DETAIL": "SigNoz | Integration",
|
||||
"PUBLIC_DASHBOARD": "SigNoz | Dashboard"
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# Extracts unique fenced code block language identifiers from all .md files under frontend/src/
|
||||
# Usage: bash frontend/scripts/extract-md-languages.sh
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
SRC_DIR="$SCRIPT_DIR/../src"
|
||||
|
||||
grep -roh '```[a-zA-Z0-9_+-]*' "$SRC_DIR" --include='*.md' \
|
||||
| sed 's/^```//' \
|
||||
| grep -v '^$' \
|
||||
| sort -u
|
||||
@@ -1,41 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# Validates that all fenced code block languages used in .md files are registered
|
||||
# in the syntax highlighter.
|
||||
# Usage: bash frontend/scripts/validate-md-languages.sh
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
SYNTAX_HIGHLIGHTER="$SCRIPT_DIR/../src/components/MarkdownRenderer/syntaxHighlighter.ts"
|
||||
|
||||
# Get all languages used in .md files
|
||||
md_languages=$("$SCRIPT_DIR/extract-md-languages.sh")
|
||||
|
||||
# Get all registered languages from syntaxHighlighter.ts
|
||||
registered_languages=$(grep -oP "registerLanguage\('\K[^']+" "$SYNTAX_HIGHLIGHTER" | sort -u)
|
||||
|
||||
missing_languages=()
|
||||
|
||||
for lang in $md_languages; do
|
||||
# Skip ai-* block markers — these are custom AI block types rendered by
|
||||
# RichCodeBlock as React components (e.g. ActionBlock, LineChartBlock),
|
||||
# not real syntax languages, so they don't need highlighter registration.
|
||||
if [[ "$lang" == ai-* ]]; then
|
||||
continue
|
||||
fi
|
||||
if ! echo "$registered_languages" | grep -qx "$lang"; then
|
||||
missing_languages+=("$lang")
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ${#missing_languages[@]} -gt 0 ]; then
|
||||
echo "Error: The following languages are used in .md files but not registered in syntaxHighlighter.ts:"
|
||||
for lang in "${missing_languages[@]}"; do
|
||||
echo " - $lang"
|
||||
done
|
||||
echo ""
|
||||
echo "Please add them to: frontend/src/components/MarkdownRenderer/syntaxHighlighter.ts"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "All markdown code block languages are registered in syntaxHighlighter.ts"
|
||||
@@ -3,7 +3,6 @@ import { matchPath, Redirect, useLocation } from 'react-router-dom';
|
||||
import getLocalStorageApi from 'api/browser/localstorage/get';
|
||||
import setLocalStorageApi from 'api/browser/localstorage/set';
|
||||
import { useListUsers } from 'api/generated/services/users';
|
||||
import { FeatureKeys } from 'constants/features';
|
||||
import { LOCALSTORAGE } from 'constants/localStorage';
|
||||
import { ORG_PREFERENCES } from 'constants/orgPreferences';
|
||||
import ROUTES from 'constants/routes';
|
||||
@@ -37,7 +36,6 @@ function PrivateRoute({ children }: PrivateRouteProps): JSX.Element {
|
||||
activeLicense,
|
||||
isFetchingActiveLicense,
|
||||
trialInfo,
|
||||
featureFlags,
|
||||
} = useAppContext();
|
||||
|
||||
const isAdmin = user.role === USER_ROLES.ADMIN;
|
||||
@@ -212,14 +210,6 @@ function PrivateRoute({ children }: PrivateRouteProps): JSX.Element {
|
||||
}
|
||||
}
|
||||
|
||||
// Check for GET_STARTED → GET_STARTED_WITH_CLOUD redirect (feature flag)
|
||||
if (
|
||||
currentRoute?.path === ROUTES.GET_STARTED &&
|
||||
featureFlags?.find((e) => e.name === FeatureKeys.ONBOARDING_V3)?.active
|
||||
) {
|
||||
return <Redirect to={ROUTES.GET_STARTED_WITH_CLOUD} />;
|
||||
}
|
||||
|
||||
// Main routing logic
|
||||
if (currentRoute) {
|
||||
const { isPrivate, key } = currentRoute;
|
||||
|
||||
@@ -2,7 +2,6 @@ import { ReactElement } from 'react';
|
||||
import { QueryClient, QueryClientProvider } from 'react-query';
|
||||
import { MemoryRouter, Route, Switch, useLocation } from 'react-router-dom';
|
||||
import { act, render, screen, waitFor } from '@testing-library/react';
|
||||
import { FeatureKeys } from 'constants/features';
|
||||
import { LOCALSTORAGE } from 'constants/localStorage';
|
||||
import { ORG_PREFERENCES } from 'constants/orgPreferences';
|
||||
import ROUTES from 'constants/routes';
|
||||
@@ -1263,80 +1262,6 @@ describe('PrivateRoute', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('Get Started Route Redirect', () => {
|
||||
it('should redirect to GET_STARTED_WITH_CLOUD when on GET_STARTED and ONBOARDING_V3 feature flag is active', async () => {
|
||||
renderPrivateRoute({
|
||||
initialRoute: ROUTES.GET_STARTED,
|
||||
appContext: {
|
||||
isLoggedIn: true,
|
||||
featureFlags: [
|
||||
{
|
||||
name: FeatureKeys.ONBOARDING_V3,
|
||||
active: true,
|
||||
usage: 0,
|
||||
usage_limit: -1,
|
||||
route: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
await assertRedirectsTo(ROUTES.GET_STARTED_WITH_CLOUD);
|
||||
});
|
||||
|
||||
it('should not redirect when on GET_STARTED and ONBOARDING_V3 feature flag is inactive', () => {
|
||||
renderPrivateRoute({
|
||||
initialRoute: ROUTES.GET_STARTED,
|
||||
appContext: {
|
||||
isLoggedIn: true,
|
||||
featureFlags: [
|
||||
{
|
||||
name: FeatureKeys.ONBOARDING_V3,
|
||||
active: false,
|
||||
usage: 0,
|
||||
usage_limit: -1,
|
||||
route: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
assertStaysOnRoute(ROUTES.GET_STARTED);
|
||||
});
|
||||
|
||||
it('should not redirect when on GET_STARTED and ONBOARDING_V3 feature flag is not present', () => {
|
||||
renderPrivateRoute({
|
||||
initialRoute: ROUTES.GET_STARTED,
|
||||
appContext: {
|
||||
isLoggedIn: true,
|
||||
featureFlags: [],
|
||||
},
|
||||
});
|
||||
|
||||
assertStaysOnRoute(ROUTES.GET_STARTED);
|
||||
});
|
||||
|
||||
it('should not redirect when on different route even if ONBOARDING_V3 is active', () => {
|
||||
renderPrivateRoute({
|
||||
initialRoute: ROUTES.HOME,
|
||||
appContext: {
|
||||
isLoggedIn: true,
|
||||
featureFlags: [
|
||||
{
|
||||
name: FeatureKeys.ONBOARDING_V3,
|
||||
active: true,
|
||||
usage: 0,
|
||||
usage_limit: -1,
|
||||
route: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
assertStaysOnRoute(ROUTES.HOME);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Loading States', () => {
|
||||
it('should not redirect while license is still being fetched', () => {
|
||||
renderPrivateRoute({
|
||||
@@ -1496,16 +1421,16 @@ describe('PrivateRoute', () => {
|
||||
await assertRedirectsTo(ROUTES.UN_AUTHORIZED);
|
||||
});
|
||||
|
||||
it('should allow EDITOR to access /get-started route', () => {
|
||||
it('should allow EDITOR to access /get-started-with-signoz-cloud route', () => {
|
||||
renderPrivateRoute({
|
||||
initialRoute: ROUTES.GET_STARTED,
|
||||
initialRoute: ROUTES.GET_STARTED_WITH_CLOUD,
|
||||
appContext: {
|
||||
isLoggedIn: true,
|
||||
user: createMockUser({ role: USER_ROLES.EDITOR as ROLES }),
|
||||
},
|
||||
});
|
||||
|
||||
assertStaysOnRoute(ROUTES.GET_STARTED);
|
||||
assertStaysOnRoute(ROUTES.GET_STARTED_WITH_CLOUD);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -90,14 +90,6 @@ export const SettingsPage = Loadable(
|
||||
() => import(/* webpackChunkName: "SettingsPage" */ 'pages/Settings'),
|
||||
);
|
||||
|
||||
export const GettingStarted = Loadable(
|
||||
() => import(/* webpackChunkName: "GettingStarted" */ 'pages/GettingStarted'),
|
||||
);
|
||||
|
||||
export const Onboarding = Loadable(
|
||||
() => import(/* webpackChunkName: "Onboarding" */ 'pages/OnboardingPage'),
|
||||
);
|
||||
|
||||
export const OrgOnboarding = Loadable(
|
||||
() => import(/* webpackChunkName: "OrgOnboarding" */ 'pages/OrgOnboarding'),
|
||||
);
|
||||
|
||||
@@ -33,7 +33,6 @@ import {
|
||||
MeterExplorerPage,
|
||||
MetricsExplorer,
|
||||
OldLogsExplorer,
|
||||
Onboarding,
|
||||
OnboardingV2,
|
||||
OrgOnboarding,
|
||||
PasswordReset,
|
||||
@@ -70,13 +69,6 @@ const routes: AppRoutes[] = [
|
||||
isPrivate: false,
|
||||
key: 'SIGN_UP',
|
||||
},
|
||||
{
|
||||
path: ROUTES.GET_STARTED,
|
||||
exact: false,
|
||||
component: Onboarding,
|
||||
isPrivate: true,
|
||||
key: 'GET_STARTED',
|
||||
},
|
||||
{
|
||||
path: ROUTES.GET_STARTED_WITH_CLOUD,
|
||||
exact: false,
|
||||
|
||||
@@ -3266,6 +3266,37 @@ export interface DashboardLinkDTO {
|
||||
url?: string;
|
||||
}
|
||||
|
||||
export interface VariableDisplayDTO {
|
||||
/**
|
||||
* @type string
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* @type boolean
|
||||
*/
|
||||
hidden?: boolean;
|
||||
/**
|
||||
* @type string
|
||||
*/
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export interface DashboardTextVariableSpecDTO {
|
||||
/**
|
||||
* @type boolean
|
||||
*/
|
||||
constant?: boolean;
|
||||
display?: VariableDisplayDTO;
|
||||
/**
|
||||
* @type string
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* @type string
|
||||
*/
|
||||
value?: string;
|
||||
}
|
||||
|
||||
export interface DashboardtypesAxesDTO {
|
||||
/**
|
||||
* @type boolean
|
||||
@@ -3297,9 +3328,6 @@ export interface DashboardtypesPanelFormattingDTO {
|
||||
unit?: string;
|
||||
}
|
||||
|
||||
export enum DashboardtypesLegendModeDTO {
|
||||
list = 'list',
|
||||
}
|
||||
export enum DashboardtypesLegendPositionDTO {
|
||||
bottom = 'bottom',
|
||||
right = 'right',
|
||||
@@ -3319,7 +3347,6 @@ export interface DashboardtypesLegendDTO {
|
||||
* @type object,null
|
||||
*/
|
||||
customColors?: DashboardtypesLegendDTOCustomColors;
|
||||
mode?: DashboardtypesLegendModeDTO;
|
||||
position?: DashboardtypesLegendPositionDTO;
|
||||
}
|
||||
|
||||
@@ -3331,7 +3358,7 @@ export interface DashboardtypesThresholdWithLabelDTO {
|
||||
/**
|
||||
* @type string
|
||||
*/
|
||||
label?: string;
|
||||
label: string;
|
||||
/**
|
||||
* @type string
|
||||
*/
|
||||
@@ -3920,24 +3947,33 @@ export interface DashboardtypesDashboardDTO {
|
||||
updatedBy?: string;
|
||||
}
|
||||
|
||||
export enum DashboardtypesDatasourcePluginVariantGithubComSigNozSignozPkgTypesDashboardtypesSigNozDatasourceSpecDTOKind {
|
||||
export enum DashboardtypesDatasourcePluginVariantStructDTOKind {
|
||||
'signoz/Datasource' = 'signoz/Datasource',
|
||||
}
|
||||
export interface DashboardtypesSigNozDatasourceSpecDTO {
|
||||
export type DashboardtypesDatasourcePluginVariantStructDTOSpecAnyOf = {
|
||||
[key: string]: unknown;
|
||||
}
|
||||
};
|
||||
|
||||
export interface DashboardtypesDatasourcePluginVariantGithubComSigNozSignozPkgTypesDashboardtypesSigNozDatasourceSpecDTO {
|
||||
/**
|
||||
* @nullable
|
||||
*/
|
||||
export type DashboardtypesDatasourcePluginVariantStructDTOSpec =
|
||||
DashboardtypesDatasourcePluginVariantStructDTOSpecAnyOf | null;
|
||||
|
||||
export interface DashboardtypesDatasourcePluginVariantStructDTO {
|
||||
/**
|
||||
* @enum signoz/Datasource
|
||||
* @type string
|
||||
*/
|
||||
kind: DashboardtypesDatasourcePluginVariantGithubComSigNozSignozPkgTypesDashboardtypesSigNozDatasourceSpecDTOKind;
|
||||
spec: DashboardtypesSigNozDatasourceSpecDTO;
|
||||
kind: DashboardtypesDatasourcePluginVariantStructDTOKind;
|
||||
/**
|
||||
* @type object,null
|
||||
*/
|
||||
spec: DashboardtypesDatasourcePluginVariantStructDTOSpec;
|
||||
}
|
||||
|
||||
export type DashboardtypesDatasourcePluginDTO =
|
||||
DashboardtypesDatasourcePluginVariantGithubComSigNozSignozPkgTypesDashboardtypesSigNozDatasourceSpecDTO;
|
||||
DashboardtypesDatasourcePluginVariantStructDTO;
|
||||
|
||||
export interface DashboardtypesDatasourceSpecDTO {
|
||||
/**
|
||||
@@ -3987,12 +4023,10 @@ export enum DashboardtypesLineStyleDTO {
|
||||
export interface DashboardtypesSpanGapsDTO {
|
||||
/**
|
||||
* @type string
|
||||
* @description The maximum gap size to connect when fillOnlyBelow is true. Gaps larger than this duration are left disconnected.
|
||||
*/
|
||||
fillLessThan?: string;
|
||||
/**
|
||||
* @type boolean
|
||||
* @description Controls whether lines connect across null values. When false (default), all gaps are connected. When true, only gaps smaller than fillLessThan are connected.
|
||||
*/
|
||||
fillOnlyBelow?: boolean;
|
||||
}
|
||||
@@ -4532,9 +4566,9 @@ export interface DashboardtypesPanelSpecDTO {
|
||||
links?: DashboardLinkDTO[];
|
||||
plugin: DashboardtypesPanelPluginDTO;
|
||||
/**
|
||||
* @type array
|
||||
* @type array,null
|
||||
*/
|
||||
queries: DashboardtypesQueryDTO[];
|
||||
queries: DashboardtypesQueryDTO[] | null;
|
||||
}
|
||||
|
||||
export interface DashboardtypesPanelDTO {
|
||||
@@ -4564,6 +4598,10 @@ export type DashboardtypesLayoutDTO =
|
||||
export enum DashboardtypesVariableEnvelopeGithubComSigNozSignozPkgTypesDashboardtypesListVariableSpecDTOKind {
|
||||
ListVariable = 'ListVariable',
|
||||
}
|
||||
export interface VariableDefaultValueDTO {
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
export enum DashboardtypesVariablePluginVariantGithubComSigNozSignozPkgTypesDashboardtypesDynamicVariableSpecDTOKind {
|
||||
'signoz/DynamicVariable' = 'signoz/DynamicVariable',
|
||||
}
|
||||
@@ -4620,17 +4658,6 @@ export type DashboardtypesVariablePluginDTO =
|
||||
| DashboardtypesVariablePluginVariantGithubComSigNozSignozPkgTypesDashboardtypesQueryVariableSpecDTO
|
||||
| DashboardtypesVariablePluginVariantGithubComSigNozSignozPkgTypesDashboardtypesCustomVariableSpecDTO;
|
||||
|
||||
export enum DashboardtypesListVariableSpecSortDTO {
|
||||
none = 'none',
|
||||
'alphabetical-asc' = 'alphabetical-asc',
|
||||
'alphabetical-desc' = 'alphabetical-desc',
|
||||
'numerical-asc' = 'numerical-asc',
|
||||
'numerical-desc' = 'numerical-desc',
|
||||
'alphabetical-ci-asc' = 'alphabetical-ci-asc',
|
||||
'alphabetical-ci-desc' = 'alphabetical-ci-desc',
|
||||
}
|
||||
export type DashboardtypesListVariableSpecDTODefaultValue = string | string[];
|
||||
|
||||
export interface DashboardtypesListVariableSpecDTO {
|
||||
/**
|
||||
* @type boolean
|
||||
@@ -4648,15 +4675,17 @@ export interface DashboardtypesListVariableSpecDTO {
|
||||
* @type string
|
||||
*/
|
||||
customAllValue?: string;
|
||||
defaultValue?: DashboardtypesListVariableSpecDTODefaultValue;
|
||||
defaultValue?: VariableDefaultValueDTO;
|
||||
display: DashboardtypesDisplayDTO;
|
||||
/**
|
||||
* @type string
|
||||
* @minLength 1
|
||||
*/
|
||||
name: string;
|
||||
name?: string;
|
||||
plugin?: DashboardtypesVariablePluginDTO;
|
||||
sort?: DashboardtypesListVariableSpecSortDTO;
|
||||
/**
|
||||
* @type string,null
|
||||
*/
|
||||
sort?: string | null;
|
||||
}
|
||||
|
||||
export interface DashboardtypesVariableEnvelopeGithubComSigNozSignozPkgTypesDashboardtypesListVariableSpecDTO {
|
||||
@@ -4668,38 +4697,21 @@ export interface DashboardtypesVariableEnvelopeGithubComSigNozSignozPkgTypesDash
|
||||
spec: DashboardtypesListVariableSpecDTO;
|
||||
}
|
||||
|
||||
export enum DashboardtypesVariableEnvelopeGithubComSigNozSignozPkgTypesDashboardtypesTextVariableSpecDTOKind {
|
||||
export enum DashboardtypesVariableEnvelopeGithubComPersesSpecGoDashboardTextVariableSpecDTOKind {
|
||||
TextVariable = 'TextVariable',
|
||||
}
|
||||
export interface DashboardtypesTextVariableSpecDTO {
|
||||
/**
|
||||
* @type boolean
|
||||
*/
|
||||
constant?: boolean;
|
||||
display: DashboardtypesDisplayDTO;
|
||||
/**
|
||||
* @type string
|
||||
* @minLength 1
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* @type string
|
||||
*/
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface DashboardtypesVariableEnvelopeGithubComSigNozSignozPkgTypesDashboardtypesTextVariableSpecDTO {
|
||||
export interface DashboardtypesVariableEnvelopeGithubComPersesSpecGoDashboardTextVariableSpecDTO {
|
||||
/**
|
||||
* @enum TextVariable
|
||||
* @type string
|
||||
*/
|
||||
kind: DashboardtypesVariableEnvelopeGithubComSigNozSignozPkgTypesDashboardtypesTextVariableSpecDTOKind;
|
||||
spec: DashboardtypesTextVariableSpecDTO;
|
||||
kind: DashboardtypesVariableEnvelopeGithubComPersesSpecGoDashboardTextVariableSpecDTOKind;
|
||||
spec: DashboardTextVariableSpecDTO;
|
||||
}
|
||||
|
||||
export type DashboardtypesVariableDTO =
|
||||
| DashboardtypesVariableEnvelopeGithubComSigNozSignozPkgTypesDashboardtypesListVariableSpecDTO
|
||||
| DashboardtypesVariableEnvelopeGithubComSigNozSignozPkgTypesDashboardtypesTextVariableSpecDTO;
|
||||
| DashboardtypesVariableEnvelopeGithubComPersesSpecGoDashboardTextVariableSpecDTO;
|
||||
|
||||
export interface DashboardtypesDashboardSpecDTO {
|
||||
/**
|
||||
@@ -9023,10 +9035,6 @@ export interface TypesUserDTO {
|
||||
updatedAt?: string;
|
||||
}
|
||||
|
||||
export interface VariableDefaultValueDTO {
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
export interface ZeustypesHostDTO {
|
||||
/**
|
||||
* @type boolean
|
||||
|
||||
@@ -21,6 +21,8 @@ interface ErrorInPlaceProps {
|
||||
width?: string | number;
|
||||
/** Custom content instead of ErrorContent */
|
||||
children?: ReactNode;
|
||||
/** Test ID for testing */
|
||||
'data-testid'?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -44,6 +46,7 @@ function ErrorInPlace({
|
||||
height = '100%',
|
||||
width = '100%',
|
||||
children,
|
||||
'data-testid': dataTestId,
|
||||
}: ErrorInPlaceProps): JSX.Element {
|
||||
const containerStyle: React.CSSProperties = {
|
||||
display: 'flex',
|
||||
@@ -59,7 +62,11 @@ function ErrorInPlace({
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={`error-in-place ${className}`.trim()} style={containerStyle}>
|
||||
<div
|
||||
className={`error-in-place ${className}`.trim()}
|
||||
style={containerStyle}
|
||||
data-testid={dataTestId}
|
||||
>
|
||||
{children || <ErrorContent error={error} />}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -62,13 +62,13 @@ function ErrorTitleAndKey({
|
||||
|
||||
switch (parentTitle) {
|
||||
case 'Consumers':
|
||||
link = `${ROUTES.GET_STARTED_APPLICATION_MONITORING}?${QueryParams.getStartedSource}=kafka&${QueryParams.getStartedSourceService}=${MessagingQueueHealthCheckService.Consumers}`;
|
||||
link = `${ROUTES.GET_STARTED_WITH_CLOUD}?${QueryParams.getStartedSource}=self-hosted-kafka&${QueryParams.getStartedSourceService}=${MessagingQueueHealthCheckService.Consumers}`;
|
||||
break;
|
||||
case 'Producers':
|
||||
link = `${ROUTES.GET_STARTED_APPLICATION_MONITORING}?${QueryParams.getStartedSource}=kafka&${QueryParams.getStartedSourceService}=${MessagingQueueHealthCheckService.Producers}`;
|
||||
link = `${ROUTES.GET_STARTED_WITH_CLOUD}?${QueryParams.getStartedSource}=self-hosted-kafka&${QueryParams.getStartedSourceService}=${MessagingQueueHealthCheckService.Producers}`;
|
||||
break;
|
||||
case 'Kafka':
|
||||
link = `${ROUTES.GET_STARTED_INFRASTRUCTURE_MONITORING}?${QueryParams.getStartedSource}=kafka&${QueryParams.getStartedSourceService}=${MessagingQueueHealthCheckService.Kafka}`;
|
||||
link = `${ROUTES.GET_STARTED_WITH_CLOUD}?${QueryParams.getStartedSource}=self-hosted-kafka&${QueryParams.getStartedSourceService}=${MessagingQueueHealthCheckService.Kafka}`;
|
||||
break;
|
||||
default:
|
||||
link = '';
|
||||
|
||||
@@ -5,13 +5,9 @@ describe('PermissionDeniedFullPage', () => {
|
||||
it('renders the title and subtitle with the permissionName interpolated', () => {
|
||||
render(<PermissionDeniedFullPage permissionName="serviceaccount:list" />);
|
||||
|
||||
expect(
|
||||
screen.getByText("Uh-oh! You don't have permission to view this page."),
|
||||
).toBeInTheDocument();
|
||||
expect(screen.getByText('Uh-oh! You are not authorized')).toBeInTheDocument();
|
||||
expect(screen.getByText(/serviceaccount:list/)).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByText(/Please ask your SigNoz administrator to grant access/),
|
||||
).toBeInTheDocument();
|
||||
expect(screen.getByText(/is not authorized to perform/)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders with a different permissionName', () => {
|
||||
|
||||
@@ -2,6 +2,7 @@ import { CircleSlash2 } from '@signozhq/icons';
|
||||
|
||||
import styles from './PermissionDeniedFullPage.module.scss';
|
||||
import { Style } from '@signozhq/design-tokens';
|
||||
import { useAppContext } from 'providers/App/App';
|
||||
|
||||
interface PermissionDeniedFullPageProps {
|
||||
permissionName: string;
|
||||
@@ -10,18 +11,18 @@ interface PermissionDeniedFullPageProps {
|
||||
function PermissionDeniedFullPage({
|
||||
permissionName,
|
||||
}: PermissionDeniedFullPageProps): JSX.Element {
|
||||
const { user } = useAppContext();
|
||||
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<div className={styles.content}>
|
||||
<span className={styles.icon}>
|
||||
<CircleSlash2 color={Style.CALLOUT_WARNING_TITLE} size={14} />
|
||||
</span>
|
||||
<p className={styles.title}>
|
||||
Uh-oh! You don't have permission to view this page.
|
||||
</p>
|
||||
<p className={styles.title}>Uh-oh! You are not authorized</p>
|
||||
<p className={styles.subtitle}>
|
||||
You need <code className={styles.permission}>{permissionName}</code> to
|
||||
view this page. Please ask your SigNoz administrator to grant access.
|
||||
<code className={styles.permission}>user/{user.id}</code> is not authorized
|
||||
to perform <code className={styles.permission}>{permissionName}</code>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { useCallback } from 'react';
|
||||
import { LockKeyhole } from '@signozhq/icons';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { Check, Copy, LockKeyhole } from '@signozhq/icons';
|
||||
import { Badge } from '@signozhq/ui/badge';
|
||||
import { Button } from '@signozhq/ui/button';
|
||||
import { Input } from '@signozhq/ui/input';
|
||||
import { useCopyToClipboard } from 'react-use';
|
||||
import type { AuthtypesRoleDTO } from 'api/generated/services/sigNoz.schemas';
|
||||
import AuthZTooltip from 'components/AuthZTooltip/AuthZTooltip';
|
||||
import RolesSelect from 'components/RolesSelect';
|
||||
@@ -46,6 +48,23 @@ function OverviewTab({
|
||||
saveErrors = [],
|
||||
}: OverviewTabProps): JSX.Element {
|
||||
const { formatTimezoneAdjustedTimestamp } = useTimezone();
|
||||
const [, copyToClipboard] = useCopyToClipboard();
|
||||
const [hasCopiedId, setHasCopiedId] = useState(false);
|
||||
|
||||
const handleCopyId = useCallback((): void => {
|
||||
if (account.id) {
|
||||
copyToClipboard(account.id);
|
||||
setHasCopiedId(true);
|
||||
}
|
||||
}, [account.id, copyToClipboard]);
|
||||
|
||||
useEffect(() => {
|
||||
if (hasCopiedId) {
|
||||
const timer = setTimeout(() => setHasCopiedId(false), 2000);
|
||||
return (): void => clearTimeout(timer);
|
||||
}
|
||||
return undefined;
|
||||
}, [hasCopiedId]);
|
||||
|
||||
const formatTimestamp = useCallback(
|
||||
(ts: string | null | undefined): string => {
|
||||
@@ -93,6 +112,17 @@ function OverviewTab({
|
||||
</label>
|
||||
<div className="sa-drawer__input-wrapper sa-drawer__input-wrapper--disabled">
|
||||
<span className="sa-drawer__input-text">{account.id || '—'}</span>
|
||||
{account.id && (
|
||||
<Button
|
||||
variant="link"
|
||||
color="secondary"
|
||||
onClick={handleCopyId}
|
||||
className="sa-drawer__copy-btn"
|
||||
data-testid="copy-id-btn"
|
||||
>
|
||||
{hasCopiedId ? <Check size={14} /> : <Copy size={14} />}
|
||||
</Button>
|
||||
)}
|
||||
<LockKeyhole size={14} className="sa-drawer__lock-icon" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -203,6 +203,19 @@
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
&__copy-btn {
|
||||
flex-shrink: 0;
|
||||
padding: 0;
|
||||
height: auto;
|
||||
min-height: auto;
|
||||
color: var(--foreground);
|
||||
opacity: 0.6;
|
||||
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
&__disabled-roles {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
@@ -16,7 +16,6 @@ import {
|
||||
import type { RenderErrorResponseDTO } from 'api/generated/services/sigNoz.schemas';
|
||||
import { AxiosError } from 'axios';
|
||||
import ErrorInPlace from 'components/ErrorInPlace/ErrorInPlace';
|
||||
import { GuardAuthZ } from 'components/GuardAuthZ/GuardAuthZ';
|
||||
import PermissionDeniedCallout from 'components/PermissionDeniedCallout/PermissionDeniedCallout';
|
||||
import { useRoles } from 'components/RolesSelect';
|
||||
import { SA_QUERY_PARAMS } from 'container/ServiceAccountsSettings/constants';
|
||||
@@ -477,15 +476,9 @@ function ServiceAccountDrawer({
|
||||
!isAccountLoading &&
|
||||
!isAccountError &&
|
||||
selectedAccountId && (
|
||||
<GuardAuthZ
|
||||
relation="read"
|
||||
object={`serviceaccount:${selectedAccountId}`}
|
||||
fallbackOnNoPermissions={(): JSX.Element => (
|
||||
<PermissionDeniedCallout permissionName="serviceaccount:read" />
|
||||
)}
|
||||
>
|
||||
<>
|
||||
{activeTab === ServiceAccountDrawerTab.Overview && account && (
|
||||
<>
|
||||
{activeTab === ServiceAccountDrawerTab.Overview &&
|
||||
(canRead && account ? (
|
||||
<OverviewTab
|
||||
account={account}
|
||||
localName={localName}
|
||||
@@ -504,23 +497,24 @@ function ServiceAccountDrawer({
|
||||
onRefetchRoles={refetchRoles}
|
||||
saveErrors={saveErrors}
|
||||
/>
|
||||
)}
|
||||
{activeTab === ServiceAccountDrawerTab.Keys &&
|
||||
(canListKeys ? (
|
||||
<KeysTab
|
||||
keys={keys}
|
||||
isLoading={keysLoading}
|
||||
isDisabled={isDeleted}
|
||||
canUpdate={canUpdate}
|
||||
accountId={selectedAccountId}
|
||||
currentPage={keysPage}
|
||||
pageSize={PAGE_SIZE}
|
||||
/>
|
||||
) : (
|
||||
<PermissionDeniedCallout permissionName="factor-api-key:list" />
|
||||
))}
|
||||
</>
|
||||
</GuardAuthZ>
|
||||
) : (
|
||||
<PermissionDeniedCallout permissionName="serviceaccount:read" />
|
||||
))}
|
||||
{activeTab === ServiceAccountDrawerTab.Keys &&
|
||||
(canListKeys ? (
|
||||
<KeysTab
|
||||
keys={keys}
|
||||
isLoading={keysLoading}
|
||||
isDisabled={isDeleted}
|
||||
canUpdate={canUpdate}
|
||||
accountId={selectedAccountId}
|
||||
currentPage={keysPage}
|
||||
pageSize={PAGE_SIZE}
|
||||
/>
|
||||
) : (
|
||||
<PermissionDeniedCallout permissionName="factor-api-key:list" />
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -22,6 +22,7 @@ jest.mock('providers/Timezone', () => ({
|
||||
},
|
||||
updateTimezone: jest.fn(),
|
||||
formatTimezoneAdjustedTimestamp: jest.fn(() => 'mock-date'),
|
||||
formatTimezoneAdjustedTimestampOptional: jest.fn(() => 'mock-date'),
|
||||
isAdaptationEnabled: true,
|
||||
setIsAdaptationEnabled: jest.fn(),
|
||||
}),
|
||||
|
||||
@@ -7,7 +7,6 @@ export enum FeatureKeys {
|
||||
GATEWAY = 'gateway',
|
||||
PREMIUM_SUPPORT = 'premium_support',
|
||||
ANOMALY_DETECTION = 'anomaly_detection',
|
||||
ONBOARDING_V3 = 'onboarding_v3',
|
||||
DOT_METRICS_ENABLED = 'dot_metrics_enabled',
|
||||
USE_JSON_BODY = 'use_json_body',
|
||||
USE_FINE_GRAINED_AUTHZ = 'use_fine_grained_authz',
|
||||
|
||||
@@ -11,14 +11,7 @@ const ROUTES = {
|
||||
TRACE_DETAIL_OLD: '/trace-old/:id',
|
||||
TRACES_EXPLORER: '/traces-explorer',
|
||||
ONBOARDING: '/onboarding',
|
||||
GET_STARTED: '/get-started',
|
||||
GET_STARTED_WITH_CLOUD: '/get-started-with-signoz-cloud',
|
||||
GET_STARTED_APPLICATION_MONITORING: '/get-started/application-monitoring',
|
||||
GET_STARTED_LOGS_MANAGEMENT: '/get-started/logs-management',
|
||||
GET_STARTED_INFRASTRUCTURE_MONITORING:
|
||||
'/get-started/infrastructure-monitoring',
|
||||
GET_STARTED_AWS_MONITORING: '/get-started/aws-monitoring',
|
||||
GET_STARTED_AZURE_MONITORING: '/get-started/azure-monitoring',
|
||||
USAGE_EXPLORER: '/usage-explorer',
|
||||
APPLICATION: '/services',
|
||||
ALL_DASHBOARD: '/dashboard',
|
||||
@@ -56,7 +49,9 @@ const ROUTES = {
|
||||
TRACE_EXPLORER: '/trace-explorer',
|
||||
BILLING: '/settings/billing',
|
||||
ROLES_SETTINGS: '/settings/roles',
|
||||
ROLE_CREATE: '/settings/roles/new',
|
||||
ROLE_DETAILS: '/settings/roles/:roleId',
|
||||
ROLE_EDIT: '/settings/roles/:roleId/edit',
|
||||
MEMBERS_SETTINGS: '/settings/members',
|
||||
SUPPORT: '/support',
|
||||
LOGS_SAVE_VIEWS: '/logs/saved-views',
|
||||
|
||||
@@ -413,14 +413,8 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
|
||||
const isPanelEditorV2 = routeKey === 'DASHBOARD_PANEL_EDITOR';
|
||||
|
||||
const renderFullScreen =
|
||||
pathname === ROUTES.GET_STARTED ||
|
||||
pathname === ROUTES.ONBOARDING ||
|
||||
pathname === ROUTES.GET_STARTED_WITH_CLOUD ||
|
||||
pathname === ROUTES.GET_STARTED_APPLICATION_MONITORING ||
|
||||
pathname === ROUTES.GET_STARTED_INFRASTRUCTURE_MONITORING ||
|
||||
pathname === ROUTES.GET_STARTED_LOGS_MANAGEMENT ||
|
||||
pathname === ROUTES.GET_STARTED_AWS_MONITORING ||
|
||||
pathname === ROUTES.GET_STARTED_AZURE_MONITORING ||
|
||||
isPublicDashboard ||
|
||||
isPanelEditorV2;
|
||||
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
.full-screen-header-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 24px 0;
|
||||
|
||||
.brand-logo {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
cursor: pointer;
|
||||
|
||||
img {
|
||||
height: 32px;
|
||||
width: 32px;
|
||||
}
|
||||
|
||||
.brand-logo-name {
|
||||
font-family: 'Work Sans', sans-serif;
|
||||
font-size: 24px;
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
line-height: 18px;
|
||||
|
||||
color: var(--l1-foreground);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
import history from 'lib/history';
|
||||
|
||||
import signozBrandLogoUrl from '@/assets/Logos/signoz-brand-logo.svg';
|
||||
|
||||
import './FullScreenHeader.styles.scss';
|
||||
|
||||
export default function FullScreenHeader({
|
||||
overrideRoute,
|
||||
}: {
|
||||
overrideRoute?: string;
|
||||
}): React.ReactElement {
|
||||
const handleLogoClick = (): void => {
|
||||
history.push(overrideRoute || '/');
|
||||
};
|
||||
return (
|
||||
<div className="full-screen-header-container">
|
||||
<div className="brand-logo" onClick={handleLogoClick}>
|
||||
<img src={signozBrandLogoUrl} alt="SigNoz" />
|
||||
|
||||
<div className="brand-logo-name">SigNoz</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
FullScreenHeader.defaultProps = {
|
||||
overrideRoute: '/',
|
||||
};
|
||||
@@ -1,10 +1,12 @@
|
||||
.members-settings {
|
||||
.members-settings-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--spacing-8);
|
||||
padding: var(--padding-4) var(--padding-2) var(--padding-6) var(--padding-4);
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.members-settings {
|
||||
&__header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -160,7 +160,7 @@ function MembersSettings(): JSX.Element {
|
||||
}, [refetchUsers]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="members-settings-page">
|
||||
<div className="members-settings">
|
||||
<div className="members-settings__header">
|
||||
<h1 className="members-settings__title">Members</h1>
|
||||
@@ -231,7 +231,7 @@ function MembersSettings(): JSX.Element {
|
||||
onClose={handleDrawerClose}
|
||||
onComplete={handleMemberEditComplete}
|
||||
/>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,15 +33,7 @@ export default function NoLogs({
|
||||
} else if (dataSource === DataSource.METRICS) {
|
||||
logEvent('Metrics Explorer: Navigate to onboarding', {});
|
||||
}
|
||||
let link;
|
||||
if (dataSource === DataSource.TRACES) {
|
||||
link = ROUTES.GET_STARTED_APPLICATION_MONITORING;
|
||||
} else if (dataSource === DataSource.METRICS) {
|
||||
link = ROUTES.GET_STARTED_WITH_CLOUD;
|
||||
} else {
|
||||
link = ROUTES.GET_STARTED_LOGS_MANAGEMENT;
|
||||
}
|
||||
history.push(link);
|
||||
history.push(ROUTES.GET_STARTED_WITH_CLOUD);
|
||||
} else if (dataSource === 'traces') {
|
||||
openInNewTab(DOCLINKS.TRACES_EXPLORER_EMPTY_STATE);
|
||||
} else if (dataSource === DataSource.METRICS) {
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
|
||||
### Step 1: Install OpenTelemetry Dependencies
|
||||
Dependencies related to OpenTelemetry exporter and SDK have to be installed first.
|
||||
|
||||
Run the below commands after navigating to the application source folder:
|
||||
```bash
|
||||
dotnet add package OpenTelemetry
|
||||
dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol
|
||||
dotnet add package OpenTelemetry.Extensions.Hosting
|
||||
dotnet add package OpenTelemetry.Instrumentation.Runtime
|
||||
dotnet add package OpenTelemetry.Instrumentation.AspNetCore
|
||||
dotnet add package OpenTelemetry.AutoInstrumentation
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Adding OpenTelemetry as a service and configuring exporter options
|
||||
|
||||
In your `Program.cs` file, add OpenTelemetry as a service. Here, we are configuring these variables:
|
||||
|
||||
`serviceName` - It is the name of your service.
|
||||
|
||||
`otlpOptions.Endpoint` - It is the endpoint for your OTel Collector agent.
|
||||
|
||||
|
||||
|
||||
Here’s a sample `Program.cs` file with the configured variables:
|
||||
|
||||
```bash
|
||||
using System.Diagnostics;
|
||||
using OpenTelemetry.Exporter;
|
||||
using OpenTelemetry.Resources;
|
||||
using OpenTelemetry.Trace;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Configure OpenTelemetry with tracing and auto-start.
|
||||
builder.Services.AddOpenTelemetry()
|
||||
.ConfigureResource(resource =>
|
||||
resource.AddService(serviceName: "{{MYAPP}}"))
|
||||
.WithTracing(tracing => tracing
|
||||
.AddAspNetCoreInstrumentation()
|
||||
.AddOtlpExporter(otlpOptions =>
|
||||
{
|
||||
//sigNoz Cloud Endpoint
|
||||
otlpOptions.Endpoint = new Uri("https://ingest.{{REGION}}.signoz.cloud:443");
|
||||
|
||||
otlpOptions.Protocol = OtlpExportProtocol.Grpc;
|
||||
|
||||
//SigNoz Cloud account Ingestion key
|
||||
string headerKey = "signoz-ingestion-key";
|
||||
string headerValue = "{{SIGNOZ_INGESTION_KEY}}";
|
||||
|
||||
string formattedHeader = $"{headerKey}={headerValue}";
|
||||
otlpOptions.Headers = formattedHeader;
|
||||
}));
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
//The index route ("/") is set up to write out the OpenTelemetry trace information on the response:
|
||||
app.MapGet("/", () => $"Hello World! OpenTelemetry Trace: {Activity.Current?.Id}");
|
||||
|
||||
app.Run();
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
The OpenTelemetry.Exporter.Options get or set the target to which the exporter is going to send traces. Here, we’re configuring it to send traces to the OTel Collector agent. The target must be a valid Uri with the scheme (http or https) and host and may contain a port and a path.
|
||||
|
||||
This is done by configuring an OpenTelemetry [TracerProvider](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/docs/trace/customizing-the-sdk#readme) using extension methods and setting it to auto-start when the host is started.
|
||||
|
||||
|
||||
### Step 3: Dockerize your application
|
||||
|
||||
Since the environment variables like SIGNOZ_INGESTION_KEY, Ingestion Endpoint and Service name are set in the `program.cs` file, you don't need to add any additional steps in your Dockerfile.
|
||||
|
||||
An **example** of a Dockerfile could look like this:
|
||||
|
||||
```bash
|
||||
|
||||
# Use the Microsoft official .NET SDK image to build the application
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the CSPROJ file and restore any dependencies (via NUGET)
|
||||
COPY *.csproj ./
|
||||
RUN dotnet restore
|
||||
|
||||
# Copy the rest of the project files and build the application
|
||||
COPY . ./
|
||||
RUN dotnet publish -c Release -o out
|
||||
|
||||
# Generate the runtime image
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0
|
||||
WORKDIR /app
|
||||
COPY --from=build-env /app/out .
|
||||
|
||||
# Expose port 5145 for the application
|
||||
EXPOSE 5145
|
||||
|
||||
# Set the ASPNETCORE_URLS environment variable to listen on port 5145
|
||||
ENV ASPNETCORE_URLS=http://+:5145
|
||||
|
||||
ENTRYPOINT ["dotnet", "YOUR-APPLICATION.dll"]
|
||||
```
|
||||
@@ -1,21 +0,0 @@
|
||||
Once you update your Dockerfile, you can build and run it using the commands below.
|
||||
|
||||
|
||||
|
||||
### Step 1: Build your dockerfile
|
||||
|
||||
Build your docker image
|
||||
|
||||
```bash
|
||||
docker build -t <your-image-name> .
|
||||
```
|
||||
|
||||
- `<your-image-name>` is the name of your Docker Image
|
||||
|
||||
|
||||
|
||||
### Step 2: Run your docker image
|
||||
|
||||
```bash
|
||||
docker run <your-image-name>
|
||||
```
|
||||
@@ -1,12 +0,0 @@
|
||||
## Setup OpenTelemetry Binary as an agent
|
||||
|
||||
|
||||
|
||||
As a first step, you should install the OTel collector Binary according to the instructions provided on [this link](https://signoz.io/docs/tutorial/opentelemetry-binary-usage-in-virtual-machine/).
|
||||
|
||||
|
||||
|
||||
Once you are done setting up the OTel collector binary, you can follow the next steps.
|
||||
|
||||
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
After setting up the Otel collector agent, follow the steps below to instrument your .NET Application
|
||||
|
||||
|
||||
|
||||
|
||||
### Step 1: Install OpenTelemetry Dependencies
|
||||
Install the following dependencies in your application.
|
||||
|
||||
```bash
|
||||
dotnet add package OpenTelemetry
|
||||
dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol
|
||||
dotnet add package OpenTelemetry.Extensions.Hosting
|
||||
dotnet add package OpenTelemetry.Instrumentation.Runtime
|
||||
dotnet add package OpenTelemetry.Instrumentation.AspNetCore
|
||||
dotnet add package OpenTelemetry.AutoInstrumentation
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Adding OpenTelemetry as a service and configuring exporter options
|
||||
|
||||
In your `Program.cs` file, add OpenTelemetry as a service. Here, we are configuring these variables:
|
||||
|
||||
`serviceName` - It is the name of your service.
|
||||
|
||||
`otlpOptions.Endpoint` - It is the endpoint for your OTel Collector agent.
|
||||
|
||||
|
||||
|
||||
Here’s a sample `Program.cs` file with the configured variables:
|
||||
|
||||
```bash
|
||||
using System.Diagnostics;
|
||||
using OpenTelemetry.Exporter;
|
||||
using OpenTelemetry.Resources;
|
||||
using OpenTelemetry.Trace;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Configure OpenTelemetry with tracing and auto-start.
|
||||
builder.Services.AddOpenTelemetry()
|
||||
.ConfigureResource(resource =>
|
||||
resource.AddService(serviceName: "{{MYAPP}}"))
|
||||
.WithTracing(tracing => tracing
|
||||
.AddAspNetCoreInstrumentation()
|
||||
.AddOtlpExporter(otlpOptions =>
|
||||
{
|
||||
otlpOptions.Endpoint = new Uri("http://localhost:4317");
|
||||
|
||||
otlpOptions.Protocol = OtlpExportProtocol.Grpc;
|
||||
}));
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
//The index route ("/") is set up to write out the OpenTelemetry trace information on the response:
|
||||
app.MapGet("/", () => $"Hello World! OpenTelemetry Trace: {Activity.Current?.Id}");
|
||||
|
||||
app.Run();
|
||||
```
|
||||
|
||||
|
||||
The OpenTelemetry.Exporter.Options get or set the target to which the exporter is going to send traces. Here, we’re configuring it to send traces to the OTel Collector agent. The target must be a valid Uri with the scheme (http or https) and host and may contain a port and a path.
|
||||
|
||||
This is done by configuring an OpenTelemetry [TracerProvider](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/docs/trace/customizing-the-sdk#readme) using extension methods and setting it to auto-start when the host is started.
|
||||
|
||||
|
||||
|
||||
|
||||
### Step 3: Dockerize your application
|
||||
|
||||
Since the crucial environment variables like SIGNOZ_INGESTION_KEY, Ingestion Endpoint and Service name are set in the `program.cs` file, you don't need to add any additional steps in your Dockerfile.
|
||||
|
||||
An **example** of a Dockerfile could look like this:
|
||||
|
||||
```bash
|
||||
|
||||
# Use the Microsoft official .NET SDK image to build the application
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the CSPROJ file and restore any dependencies (via NUGET)
|
||||
COPY *.csproj ./
|
||||
RUN dotnet restore
|
||||
|
||||
# Copy the rest of the project files and build the application
|
||||
COPY . ./
|
||||
RUN dotnet publish -c Release -o out
|
||||
|
||||
# Generate the runtime image
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0
|
||||
WORKDIR /app
|
||||
COPY --from=build-env /app/out .
|
||||
|
||||
# Expose port 5145 for the application
|
||||
EXPOSE 5145
|
||||
|
||||
# Set the ASPNETCORE_URLS environment variable to listen on port 5145
|
||||
ENV ASPNETCORE_URLS=http://+:5145
|
||||
|
||||
ENTRYPOINT ["dotnet", "YOUR-APPLICATION.dll"]
|
||||
```
|
||||
@@ -1,21 +0,0 @@
|
||||
Once you update your Dockerfile, you can build and run it using the commands below.
|
||||
|
||||
|
||||
|
||||
### Step 1: Build your dockerfile
|
||||
|
||||
Build your docker image
|
||||
|
||||
```bash
|
||||
docker build -t <your-image-name> .
|
||||
```
|
||||
|
||||
- `<your-image-name>` is the name of your Docker Image
|
||||
|
||||
|
||||
|
||||
### Step 2: Run your docker image
|
||||
|
||||
```bash
|
||||
docker run <your-image-name>
|
||||
```
|
||||
@@ -1,43 +0,0 @@
|
||||
### Install otel-collector in your Kubernetes infra
|
||||
|
||||
Add the SigNoz Helm Chart repository
|
||||
```bash
|
||||
helm repo add signoz https://charts.signoz.io
|
||||
```
|
||||
|
||||
|
||||
|
||||
If the chart is already present, update the chart to the latest using:
|
||||
```bash
|
||||
helm repo update
|
||||
```
|
||||
|
||||
|
||||
|
||||
For generic Kubernetes clusters, you can create *override-values.yaml* with the following configuration:
|
||||
|
||||
```yaml
|
||||
global:
|
||||
cloud: others
|
||||
clusterName: <CLUSTER_NAME>
|
||||
deploymentEnvironment: <DEPLOYMENT_ENVIRONMENT>
|
||||
otelCollectorEndpoint: ingest.{{REGION}}.signoz.cloud:443
|
||||
otelInsecure: false
|
||||
signozApiKey: {{SIGNOZ_INGESTION_KEY}}
|
||||
presets:
|
||||
otlpExporter:
|
||||
enabled: true
|
||||
loggingExporter:
|
||||
enabled: false
|
||||
```
|
||||
|
||||
- Replace `<CLUSTER_NAME>` with the name of the Kubernetes cluster or a unique identifier of the cluster.
|
||||
- Replace `<DEPLOYMENT_ENVIRONMENT>` with the deployment environment of your application. Example: **"staging"**, **"production"**, etc.
|
||||
|
||||
|
||||
|
||||
To install the k8s-infra chart with the above configuration, run the following command:
|
||||
|
||||
```bash
|
||||
helm install my-release signoz/k8s-infra -f override-values.yaml
|
||||
```
|
||||
@@ -1,65 +0,0 @@
|
||||
After setting up the Otel collector agent, follow the steps below to instrument your .NET Application
|
||||
|
||||
|
||||
|
||||
### Step 1: Install OpenTelemetry Dependencies
|
||||
Install the following dependencies in your application.
|
||||
|
||||
```bash
|
||||
dotnet add package OpenTelemetry
|
||||
dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol
|
||||
dotnet add package OpenTelemetry.Extensions.Hosting
|
||||
dotnet add package OpenTelemetry.Instrumentation.Runtime
|
||||
dotnet add package OpenTelemetry.Instrumentation.AspNetCore
|
||||
dotnet add package OpenTelemetry.AutoInstrumentation
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Adding OpenTelemetry as a service and configuring exporter options
|
||||
|
||||
In your `Program.cs` file, add OpenTelemetry as a service. Here, we are configuring these variables:
|
||||
|
||||
`serviceName` - It is the name of your service.
|
||||
|
||||
`otlpOptions.Endpoint` - It is the endpoint for your OTel Collector agent.
|
||||
|
||||
|
||||
|
||||
Here’s a sample `Program.cs` file with the configured variables:
|
||||
|
||||
```bash
|
||||
using System.Diagnostics;
|
||||
using OpenTelemetry.Exporter;
|
||||
using OpenTelemetry.Resources;
|
||||
using OpenTelemetry.Trace;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Configure OpenTelemetry with tracing and auto-start.
|
||||
builder.Services.AddOpenTelemetry()
|
||||
.ConfigureResource(resource =>
|
||||
resource.AddService(serviceName: "{{MYAPP}}"))
|
||||
.WithTracing(tracing => tracing
|
||||
.AddAspNetCoreInstrumentation()
|
||||
.AddOtlpExporter(otlpOptions =>
|
||||
{
|
||||
otlpOptions.Endpoint = new Uri("http://localhost:4317");
|
||||
|
||||
otlpOptions.Protocol = OtlpExportProtocol.Grpc;
|
||||
}));
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
//The index route ("/") is set up to write out the OpenTelemetry trace information on the response:
|
||||
app.MapGet("/", () => $"Hello World! OpenTelemetry Trace: {Activity.Current?.Id}");
|
||||
|
||||
app.Run();
|
||||
```
|
||||
|
||||
The OpenTelemetry.Exporter.Options get or set the target to which the exporter is going to send traces. Here, we’re configuring it to send traces to the OTel Collector agent. The target must be a valid Uri with the scheme (http or https) and host and may contain a port and a path.
|
||||
|
||||
This is done by configuring an OpenTelemetry [TracerProvider](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/docs/trace/customizing-the-sdk#readme) using extension methods and setting it to auto-start when the host is started.
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
|
||||
|
||||
To run your .NET application, use the below command :
|
||||
|
||||
```bash
|
||||
dotnet build
|
||||
dotnet run
|
||||
```
|
||||
|
||||
Once you run your .NET application, interact with your application to generate some load and see your application in the SigNoz UI.
|
||||
@@ -1,71 +0,0 @@
|
||||
|
||||
### Step 1: Install OpenTelemetry Dependencies
|
||||
Dependencies related to OpenTelemetry exporter and SDK have to be installed first.
|
||||
|
||||
Run the below commands after navigating to the application source folder:
|
||||
```bash
|
||||
dotnet add package OpenTelemetry
|
||||
dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol
|
||||
dotnet add package OpenTelemetry.Extensions.Hosting
|
||||
dotnet add package OpenTelemetry.Instrumentation.Runtime
|
||||
dotnet add package OpenTelemetry.Instrumentation.AspNetCore
|
||||
dotnet add package OpenTelemetry.AutoInstrumentation
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Adding OpenTelemetry as a service and configuring exporter options
|
||||
|
||||
In your `Program.cs` file, add OpenTelemetry as a service. Here, we are configuring these variables:
|
||||
|
||||
`serviceName` - It is the name of your service.
|
||||
|
||||
`otlpOptions.Endpoint` - It is the endpoint for your OTel Collector agent.
|
||||
|
||||
|
||||
|
||||
Here’s a sample `Program.cs` file with the configured variables:
|
||||
|
||||
```bash
|
||||
using System.Diagnostics;
|
||||
using OpenTelemetry.Exporter;
|
||||
using OpenTelemetry.Resources;
|
||||
using OpenTelemetry.Trace;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Configure OpenTelemetry with tracing and auto-start.
|
||||
builder.Services.AddOpenTelemetry()
|
||||
.ConfigureResource(resource =>
|
||||
resource.AddService(serviceName: "{{MYAPP}}"))
|
||||
.WithTracing(tracing => tracing
|
||||
.AddAspNetCoreInstrumentation()
|
||||
.AddOtlpExporter(otlpOptions =>
|
||||
{
|
||||
//sigNoz Cloud Endpoint
|
||||
otlpOptions.Endpoint = new Uri("https://ingest.{{REGION}}.signoz.cloud:443");
|
||||
|
||||
otlpOptions.Protocol = OtlpExportProtocol.Grpc;
|
||||
|
||||
//SigNoz Cloud account Ingestion key
|
||||
string headerKey = "signoz-ingestion-key";
|
||||
string headerValue = "{{SIGNOZ_INGESTION_KEY}}";
|
||||
|
||||
string formattedHeader = $"{headerKey}={headerValue}";
|
||||
otlpOptions.Headers = formattedHeader;
|
||||
}));
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
//The index route ("/") is set up to write out the OpenTelemetry trace information on the response:
|
||||
app.MapGet("/", () => $"Hello World! OpenTelemetry Trace: {Activity.Current?.Id}");
|
||||
|
||||
app.Run();
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
The OpenTelemetry.Exporter.Options get or set the target to which the exporter is going to send traces. Here, we’re configuring it to send traces to the OTel Collector agent. The target must be a valid Uri with the scheme (http or https) and host and may contain a port and a path.
|
||||
|
||||
This is done by configuring an OpenTelemetry [TracerProvider](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/docs/trace/customizing-the-sdk#readme) using extension methods and setting it to auto-start when the host is started.
|
||||
@@ -1,10 +0,0 @@
|
||||
|
||||
To run your .NET application, use the below command :
|
||||
|
||||
```bash
|
||||
dotnet build
|
||||
dotnet run
|
||||
```
|
||||
|
||||
Once you run your .NET application, interact with your application to generate some load and see your application in the SigNoz UI.
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
## Setup OpenTelemetry Binary as an agent
|
||||
|
||||
|
||||
### Step 1: Download otel-collector tar.gz
|
||||
```bash
|
||||
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v{{OTEL_VERSION}}/otelcol-contrib_{{OTEL_VERSION}}_linux_amd64.tar.gz
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Extract otel-collector tar.gz to the `otelcol-contrib` folder
|
||||
```bash
|
||||
mkdir otelcol-contrib && tar xvzf otelcol-contrib_{{OTEL_VERSION}}_linux_amd64.tar.gz -C otelcol-contrib
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 3: Create `config.yaml` in `otelcol-contrib` folder with the below content in it
|
||||
```bash
|
||||
receivers:
|
||||
otlp:
|
||||
protocols:
|
||||
grpc:
|
||||
endpoint: 0.0.0.0:4317
|
||||
http:
|
||||
endpoint: 0.0.0.0:4318
|
||||
hostmetrics:
|
||||
collection_interval: 60s
|
||||
scrapers:
|
||||
cpu: {}
|
||||
disk: {}
|
||||
load: {}
|
||||
filesystem: {}
|
||||
memory: {}
|
||||
network: {}
|
||||
paging: {}
|
||||
process:
|
||||
mute_process_name_error: true
|
||||
mute_process_exe_error: true
|
||||
mute_process_io_error: true
|
||||
processes: {}
|
||||
prometheus:
|
||||
config:
|
||||
global:
|
||||
scrape_interval: 60s
|
||||
scrape_configs:
|
||||
- job_name: otel-collector-binary
|
||||
static_configs:
|
||||
- targets:
|
||||
# - localhost:8888
|
||||
processors:
|
||||
batch:
|
||||
send_batch_size: 1000
|
||||
timeout: 10s
|
||||
# Ref: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/resourcedetectionprocessor/README.md
|
||||
resourcedetection:
|
||||
detectors: [env, system] # Before system detector, include ec2 for AWS, gcp for GCP and azure for Azure.
|
||||
# Using OTEL_RESOURCE_ATTRIBUTES envvar, env detector adds custom labels.
|
||||
timeout: 2s
|
||||
system:
|
||||
hostname_sources: [os] # alternatively, use [dns,os] for setting FQDN as host.name and os as fallback
|
||||
extensions:
|
||||
health_check: {}
|
||||
zpages: {}
|
||||
exporters:
|
||||
otlp:
|
||||
endpoint: "ingest.{{REGION}}.signoz.cloud:443"
|
||||
tls:
|
||||
insecure: false
|
||||
headers:
|
||||
"signoz-ingestion-key": "{{SIGNOZ_INGESTION_KEY}}"
|
||||
logging:
|
||||
verbosity: normal
|
||||
service:
|
||||
telemetry:
|
||||
metrics:
|
||||
address: 0.0.0.0:8888
|
||||
extensions: [health_check, zpages]
|
||||
pipelines:
|
||||
metrics:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
metrics/internal:
|
||||
receivers: [prometheus, hostmetrics]
|
||||
processors: [resourcedetection, batch]
|
||||
exporters: [otlp]
|
||||
traces:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
logs:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
```
|
||||
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
After setting up the Otel collector agent, follow the steps below to instrument your .NET Application
|
||||
|
||||
|
||||
|
||||
|
||||
### Step 1: Install OpenTelemetry Dependencies
|
||||
Install the following dependencies in your application.
|
||||
|
||||
```bash
|
||||
dotnet add package OpenTelemetry
|
||||
dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol
|
||||
dotnet add package OpenTelemetry.Extensions.Hosting
|
||||
dotnet add package OpenTelemetry.Instrumentation.Runtime
|
||||
dotnet add package OpenTelemetry.Instrumentation.AspNetCore
|
||||
dotnet add package OpenTelemetry.AutoInstrumentation
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Adding OpenTelemetry as a service and configuring exporter options
|
||||
|
||||
In your `Program.cs` file, add OpenTelemetry as a service. Here, we are configuring these variables:
|
||||
|
||||
`serviceName` - It is the name of your service.
|
||||
|
||||
`otlpOptions.Endpoint` - It is the endpoint for your OTel Collector agent.
|
||||
|
||||
|
||||
|
||||
Here’s a sample `Program.cs` file with the configured variables:
|
||||
|
||||
```bash
|
||||
using System.Diagnostics;
|
||||
using OpenTelemetry.Exporter;
|
||||
using OpenTelemetry.Resources;
|
||||
using OpenTelemetry.Trace;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Configure OpenTelemetry with tracing and auto-start.
|
||||
builder.Services.AddOpenTelemetry()
|
||||
.ConfigureResource(resource =>
|
||||
resource.AddService(serviceName: "{{MYAPP}}"))
|
||||
.WithTracing(tracing => tracing
|
||||
.AddAspNetCoreInstrumentation()
|
||||
.AddOtlpExporter(otlpOptions =>
|
||||
{
|
||||
otlpOptions.Endpoint = new Uri("http://localhost:4317");
|
||||
|
||||
otlpOptions.Protocol = OtlpExportProtocol.Grpc;
|
||||
}));
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
//The index route ("/") is set up to write out the OpenTelemetry trace information on the response:
|
||||
app.MapGet("/", () => $"Hello World! OpenTelemetry Trace: {Activity.Current?.Id}");
|
||||
|
||||
app.Run();
|
||||
```
|
||||
|
||||
|
||||
The OpenTelemetry.Exporter.Options get or set the target to which the exporter is going to send traces. Here, we’re configuring it to send traces to the OTel Collector agent. The target must be a valid Uri with the scheme (http or https) and host and may contain a port and a path.
|
||||
|
||||
This is done by configuring an OpenTelemetry [TracerProvider](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/docs/trace/customizing-the-sdk#readme) using extension methods and setting it to auto-start when the host is started.
|
||||
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
|
||||
Once you are done intrumenting your .NET application, you can run it using the below commands
|
||||
|
||||
|
||||
### Step 1: Run OTel Collector
|
||||
Run this command inside the `otelcol-contrib` directory that you created in the install Otel Collector step
|
||||
|
||||
```bash
|
||||
./otelcol-contrib --config ./config.yaml
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Run your .NET application
|
||||
```bash
|
||||
dotnet build
|
||||
dotnet run
|
||||
```
|
||||
@@ -1,70 +0,0 @@
|
||||
|
||||
### Step 1: Install OpenTelemetry Dependencies
|
||||
Dependencies related to OpenTelemetry exporter and SDK have to be installed first.
|
||||
|
||||
Run the below commands after navigating to the application source folder:
|
||||
```bash
|
||||
dotnet add package OpenTelemetry
|
||||
dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol
|
||||
dotnet add package OpenTelemetry.Extensions.Hosting
|
||||
dotnet add package OpenTelemetry.Instrumentation.Runtime
|
||||
dotnet add package OpenTelemetry.Instrumentation.AspNetCore
|
||||
dotnet add package OpenTelemetry.AutoInstrumentation
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Adding OpenTelemetry as a service and configuring exporter options
|
||||
|
||||
In your `Program.cs` file, add OpenTelemetry as a service. Here, we are configuring these variables:
|
||||
|
||||
`serviceName` - It is the name of your service.
|
||||
|
||||
`otlpOptions.Endpoint` - It is the endpoint for your OTel Collector agent.
|
||||
|
||||
|
||||
|
||||
Here’s a sample `Program.cs` file with the configured variables:
|
||||
|
||||
```bash
|
||||
using System.Diagnostics;
|
||||
using OpenTelemetry.Exporter;
|
||||
using OpenTelemetry.Resources;
|
||||
using OpenTelemetry.Trace;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Configure OpenTelemetry with tracing and auto-start.
|
||||
builder.Services.AddOpenTelemetry()
|
||||
.ConfigureResource(resource =>
|
||||
resource.AddService(serviceName: "{{MYAPP}}"))
|
||||
.WithTracing(tracing => tracing
|
||||
.AddAspNetCoreInstrumentation()
|
||||
.AddOtlpExporter(otlpOptions =>
|
||||
{
|
||||
//sigNoz Cloud Endpoint
|
||||
otlpOptions.Endpoint = new Uri("https://ingest.{{REGION}}.signoz.cloud:443");
|
||||
|
||||
otlpOptions.Protocol = OtlpExportProtocol.Grpc;
|
||||
|
||||
//SigNoz Cloud account Ingestion key
|
||||
string headerKey = "signoz-ingestion-key";
|
||||
string headerValue = "{{SIGNOZ_INGESTION_KEY}}";
|
||||
|
||||
string formattedHeader = $"{headerKey}={headerValue}";
|
||||
otlpOptions.Headers = formattedHeader;
|
||||
}));
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
//The index route ("/") is set up to write out the OpenTelemetry trace information on the response:
|
||||
app.MapGet("/", () => $"Hello World! OpenTelemetry Trace: {Activity.Current?.Id}");
|
||||
|
||||
app.Run();
|
||||
```
|
||||
|
||||
|
||||
|
||||
The OpenTelemetry.Exporter.Options get or set the target to which the exporter is going to send traces. Here, we’re configuring it to send traces to the OTel Collector agent. The target must be a valid Uri with the scheme (http or https) and host and may contain a port and a path.
|
||||
|
||||
This is done by configuring an OpenTelemetry [TracerProvider](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/docs/trace/customizing-the-sdk#readme) using extension methods and setting it to auto-start when the host is started.
|
||||
@@ -1,10 +0,0 @@
|
||||
|
||||
To run your .NET application, use the below command :
|
||||
|
||||
```bash
|
||||
dotnet build
|
||||
dotnet run
|
||||
```
|
||||
|
||||
Once you run your .NET application, interact with your application to generate some load and see your application in the SigNoz UI.
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
## Setup OpenTelemetry Binary as an agent
|
||||
|
||||
|
||||
|
||||
### Step 1: Download otel-collector tar.gz
|
||||
```bash
|
||||
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v{{OTEL_VERSION}}/otelcol-contrib_{{OTEL_VERSION}}_linux_arm64.tar.gz
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Extract otel-collector tar.gz to the `otelcol-contrib` folder
|
||||
```bash
|
||||
mkdir otelcol-contrib && tar xvzf otelcol-contrib_{{OTEL_VERSION}}_linux_arm64.tar.gz -C otelcol-contrib
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 3: Create `config.yaml` in `otelcol-contrib` folder with the below content in it
|
||||
```bash
|
||||
receivers:
|
||||
otlp:
|
||||
protocols:
|
||||
grpc:
|
||||
endpoint: 0.0.0.0:4317
|
||||
http:
|
||||
endpoint: 0.0.0.0:4318
|
||||
hostmetrics:
|
||||
collection_interval: 60s
|
||||
scrapers:
|
||||
cpu: {}
|
||||
disk: {}
|
||||
load: {}
|
||||
filesystem: {}
|
||||
memory: {}
|
||||
network: {}
|
||||
paging: {}
|
||||
process:
|
||||
mute_process_name_error: true
|
||||
mute_process_exe_error: true
|
||||
mute_process_io_error: true
|
||||
processes: {}
|
||||
prometheus:
|
||||
config:
|
||||
global:
|
||||
scrape_interval: 60s
|
||||
scrape_configs:
|
||||
- job_name: otel-collector-binary
|
||||
static_configs:
|
||||
- targets:
|
||||
# - localhost:8888
|
||||
processors:
|
||||
batch:
|
||||
send_batch_size: 1000
|
||||
timeout: 10s
|
||||
# Ref: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/resourcedetectionprocessor/README.md
|
||||
resourcedetection:
|
||||
detectors: [env, system] # Before system detector, include ec2 for AWS, gcp for GCP and azure for Azure.
|
||||
# Using OTEL_RESOURCE_ATTRIBUTES envvar, env detector adds custom labels.
|
||||
timeout: 2s
|
||||
system:
|
||||
hostname_sources: [os] # alternatively, use [dns,os] for setting FQDN as host.name and os as fallback
|
||||
extensions:
|
||||
health_check: {}
|
||||
zpages: {}
|
||||
exporters:
|
||||
otlp:
|
||||
endpoint: "ingest.{{REGION}}.signoz.cloud:443"
|
||||
tls:
|
||||
insecure: false
|
||||
headers:
|
||||
"signoz-ingestion-key": "{{SIGNOZ_INGESTION_KEY}}"
|
||||
logging:
|
||||
verbosity: normal
|
||||
service:
|
||||
telemetry:
|
||||
metrics:
|
||||
address: 0.0.0.0:8888
|
||||
extensions: [health_check, zpages]
|
||||
pipelines:
|
||||
metrics:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
metrics/internal:
|
||||
receivers: [prometheus, hostmetrics]
|
||||
processors: [resourcedetection, batch]
|
||||
exporters: [otlp]
|
||||
traces:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
logs:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
```
|
||||
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
After setting up the Otel collector agent, follow the steps below to instrument your .NET Application
|
||||
|
||||
|
||||
|
||||
|
||||
### Step 1: Install OpenTelemetry Dependencies
|
||||
Install the following dependencies in your application.
|
||||
|
||||
```bash
|
||||
dotnet add package OpenTelemetry
|
||||
dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol
|
||||
dotnet add package OpenTelemetry.Extensions.Hosting
|
||||
dotnet add package OpenTelemetry.Instrumentation.Runtime
|
||||
dotnet add package OpenTelemetry.Instrumentation.AspNetCore
|
||||
dotnet add package OpenTelemetry.AutoInstrumentation
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Adding OpenTelemetry as a service and configuring exporter options
|
||||
|
||||
In your `Program.cs` file, add OpenTelemetry as a service. Here, we are configuring these variables:
|
||||
|
||||
`serviceName` - It is the name of your service.
|
||||
|
||||
`otlpOptions.Endpoint` - It is the endpoint for your OTel Collector agent.
|
||||
|
||||
|
||||
|
||||
Here’s a sample `Program.cs` file with the configured variables:
|
||||
|
||||
```bash
|
||||
using System.Diagnostics;
|
||||
using OpenTelemetry.Exporter;
|
||||
using OpenTelemetry.Resources;
|
||||
using OpenTelemetry.Trace;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Configure OpenTelemetry with tracing and auto-start.
|
||||
builder.Services.AddOpenTelemetry()
|
||||
.ConfigureResource(resource =>
|
||||
resource.AddService(serviceName: "{{MYAPP}}"))
|
||||
.WithTracing(tracing => tracing
|
||||
.AddAspNetCoreInstrumentation()
|
||||
.AddOtlpExporter(otlpOptions =>
|
||||
{
|
||||
otlpOptions.Endpoint = new Uri("http://localhost:4317");
|
||||
|
||||
otlpOptions.Protocol = OtlpExportProtocol.Grpc;
|
||||
}));
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
//The index route ("/") is set up to write out the OpenTelemetry trace information on the response:
|
||||
app.MapGet("/", () => $"Hello World! OpenTelemetry Trace: {Activity.Current?.Id}");
|
||||
|
||||
app.Run();
|
||||
```
|
||||
|
||||
|
||||
|
||||
The OpenTelemetry.Exporter.Options get or set the target to which the exporter is going to send traces. Here, we’re configuring it to send traces to the OTel Collector agent. The target must be a valid Uri with the scheme (http or https) and host and may contain a port and a path.
|
||||
|
||||
This is done by configuring an OpenTelemetry [TracerProvider](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/docs/trace/customizing-the-sdk#readme) using extension methods and setting it to auto-start when the host is started.
|
||||
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
|
||||
Once you are done intrumenting your .NET application, you can run it using the below commands
|
||||
|
||||
|
||||
### Step 1: Run OTel Collector
|
||||
Run this command inside the `otelcol-contrib` directory that you created in the install Otel Collector step
|
||||
|
||||
```bash
|
||||
./otelcol-contrib --config ./config.yaml
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Run your .NET application
|
||||
```bash
|
||||
dotnet build
|
||||
dotnet run
|
||||
```
|
||||
@@ -1,70 +0,0 @@
|
||||
|
||||
### Step 1: Install OpenTelemetry Dependencies
|
||||
Dependencies related to OpenTelemetry exporter and SDK have to be installed first.
|
||||
|
||||
Run the below commands after navigating to the application source folder:
|
||||
```bash
|
||||
dotnet add package OpenTelemetry
|
||||
dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol
|
||||
dotnet add package OpenTelemetry.Extensions.Hosting
|
||||
dotnet add package OpenTelemetry.Instrumentation.Runtime
|
||||
dotnet add package OpenTelemetry.Instrumentation.AspNetCore
|
||||
dotnet add package OpenTelemetry.AutoInstrumentation
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Adding OpenTelemetry as a service and configuring exporter options
|
||||
|
||||
In your `Program.cs` file, add OpenTelemetry as a service. Here, we are configuring these variables:
|
||||
|
||||
`serviceName` - It is the name of your service.
|
||||
|
||||
`otlpOptions.Endpoint` - It is the endpoint for your OTel Collector agent.
|
||||
|
||||
|
||||
|
||||
Here’s a sample `Program.cs` file with the configured variables:
|
||||
|
||||
```bash
|
||||
using System.Diagnostics;
|
||||
using OpenTelemetry.Exporter;
|
||||
using OpenTelemetry.Resources;
|
||||
using OpenTelemetry.Trace;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Configure OpenTelemetry with tracing and auto-start.
|
||||
builder.Services.AddOpenTelemetry()
|
||||
.ConfigureResource(resource =>
|
||||
resource.AddService(serviceName: "{{MYAPP}}"))
|
||||
.WithTracing(tracing => tracing
|
||||
.AddAspNetCoreInstrumentation()
|
||||
.AddOtlpExporter(otlpOptions =>
|
||||
{
|
||||
//sigNoz Cloud Endpoint
|
||||
otlpOptions.Endpoint = new Uri("https://ingest.{{REGION}}.signoz.cloud:443");
|
||||
|
||||
otlpOptions.Protocol = OtlpExportProtocol.Grpc;
|
||||
|
||||
//SigNoz Cloud account Ingestion key
|
||||
string headerKey = "signoz-ingestion-key";
|
||||
string headerValue = "{{SIGNOZ_INGESTION_KEY}}";
|
||||
|
||||
string formattedHeader = $"{headerKey}={headerValue}";
|
||||
otlpOptions.Headers = formattedHeader;
|
||||
}));
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
//The index route ("/") is set up to write out the OpenTelemetry trace information on the response:
|
||||
app.MapGet("/", () => $"Hello World! OpenTelemetry Trace: {Activity.Current?.Id}");
|
||||
|
||||
app.Run();
|
||||
```
|
||||
|
||||
|
||||
|
||||
The OpenTelemetry.Exporter.Options get or set the target to which the exporter is going to send traces. Here, we’re configuring it to send traces to the OTel Collector agent. The target must be a valid Uri with the scheme (http or https) and host and may contain a port and a path.
|
||||
|
||||
This is done by configuring an OpenTelemetry [TracerProvider](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/docs/trace/customizing-the-sdk#readme) using extension methods and setting it to auto-start when the host is started.
|
||||
@@ -1,10 +0,0 @@
|
||||
|
||||
To run your .NET application, use the below command :
|
||||
|
||||
```bash
|
||||
dotnet build
|
||||
dotnet run
|
||||
```
|
||||
|
||||
Once you run your .NET application, interact with your application to generate some load and see your application in the SigNoz UI.
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
## Setup OpenTelemetry Binary as an agent
|
||||
|
||||
|
||||
### Step 1: Download otel-collector tar.gz
|
||||
```bash
|
||||
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v{{OTEL_VERSION}}/otelcol-contrib_{{OTEL_VERSION}}_darwin_amd64.tar.gz
|
||||
```
|
||||
|
||||
|
||||
### Step 2: Extract otel-collector tar.gz to the `otelcol-contrib` folder
|
||||
```bash
|
||||
mkdir otelcol-contrib && tar xvzf otelcol-contrib_{{OTEL_VERSION}}_darwin_amd64.tar.gz -C otelcol-contrib
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 3: Create `config.yaml` in folder `otelcol-contrib` with the below content in it
|
||||
```bash
|
||||
receivers:
|
||||
otlp:
|
||||
protocols:
|
||||
grpc:
|
||||
endpoint: 0.0.0.0:4317
|
||||
http:
|
||||
endpoint: 0.0.0.0:4318
|
||||
hostmetrics:
|
||||
collection_interval: 60s
|
||||
scrapers:
|
||||
cpu: {}
|
||||
disk: {}
|
||||
load: {}
|
||||
filesystem: {}
|
||||
memory: {}
|
||||
network: {}
|
||||
paging: {}
|
||||
process:
|
||||
mute_process_name_error: true
|
||||
mute_process_exe_error: true
|
||||
mute_process_io_error: true
|
||||
processes: {}
|
||||
prometheus:
|
||||
config:
|
||||
global:
|
||||
scrape_interval: 60s
|
||||
scrape_configs:
|
||||
- job_name: otel-collector-binary
|
||||
static_configs:
|
||||
- targets:
|
||||
# - localhost:8888
|
||||
processors:
|
||||
batch:
|
||||
send_batch_size: 1000
|
||||
timeout: 10s
|
||||
# Ref: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/resourcedetectionprocessor/README.md
|
||||
resourcedetection:
|
||||
detectors: [env, system] # Before system detector, include ec2 for AWS, gcp for GCP and azure for Azure.
|
||||
# Using OTEL_RESOURCE_ATTRIBUTES envvar, env detector adds custom labels.
|
||||
timeout: 2s
|
||||
system:
|
||||
hostname_sources: [os] # alternatively, use [dns,os] for setting FQDN as host.name and os as fallback
|
||||
extensions:
|
||||
health_check: {}
|
||||
zpages: {}
|
||||
exporters:
|
||||
otlp:
|
||||
endpoint: "ingest.{{REGION}}.signoz.cloud:443"
|
||||
tls:
|
||||
insecure: false
|
||||
headers:
|
||||
"signoz-ingestion-key": "{{SIGNOZ_INGESTION_KEY}}"
|
||||
logging:
|
||||
verbosity: normal
|
||||
service:
|
||||
telemetry:
|
||||
metrics:
|
||||
address: 0.0.0.0:8888
|
||||
extensions: [health_check, zpages]
|
||||
pipelines:
|
||||
metrics:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
metrics/internal:
|
||||
receivers: [prometheus, hostmetrics]
|
||||
processors: [resourcedetection, batch]
|
||||
exporters: [otlp]
|
||||
traces:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
logs:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
```
|
||||
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
After setting up the Otel collector agent, follow the steps below to instrument your .NET Application
|
||||
|
||||
|
||||
|
||||
|
||||
### Step 1: Install OpenTelemetry Dependencies
|
||||
Install the following dependencies in your application.
|
||||
|
||||
```bash
|
||||
dotnet add package OpenTelemetry
|
||||
dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol
|
||||
dotnet add package OpenTelemetry.Extensions.Hosting
|
||||
dotnet add package OpenTelemetry.Instrumentation.Runtime
|
||||
dotnet add package OpenTelemetry.Instrumentation.AspNetCore
|
||||
dotnet add package OpenTelemetry.AutoInstrumentation
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Adding OpenTelemetry as a service and configuring exporter options
|
||||
|
||||
In your `Program.cs` file, add OpenTelemetry as a service. Here, we are configuring these variables:
|
||||
|
||||
`serviceName` - It is the name of your service.
|
||||
|
||||
`otlpOptions.Endpoint` - It is the endpoint for your OTel Collector agent.
|
||||
|
||||
|
||||
|
||||
Here’s a sample `Program.cs` file with the configured variables:
|
||||
|
||||
```bash
|
||||
using System.Diagnostics;
|
||||
using OpenTelemetry.Exporter;
|
||||
using OpenTelemetry.Resources;
|
||||
using OpenTelemetry.Trace;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Configure OpenTelemetry with tracing and auto-start.
|
||||
builder.Services.AddOpenTelemetry()
|
||||
.ConfigureResource(resource =>
|
||||
resource.AddService(serviceName: "{{MYAPP}}"))
|
||||
.WithTracing(tracing => tracing
|
||||
.AddAspNetCoreInstrumentation()
|
||||
.AddOtlpExporter(otlpOptions =>
|
||||
{
|
||||
otlpOptions.Endpoint = new Uri("http://localhost:4317");
|
||||
|
||||
otlpOptions.Protocol = OtlpExportProtocol.Grpc;
|
||||
}));
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
//The index route ("/") is set up to write out the OpenTelemetry trace information on the response:
|
||||
app.MapGet("/", () => $"Hello World! OpenTelemetry Trace: {Activity.Current?.Id}");
|
||||
|
||||
app.Run();
|
||||
```
|
||||
|
||||
|
||||
The OpenTelemetry.Exporter.Options get or set the target to which the exporter is going to send traces. Here, we’re configuring it to send traces to the OTel Collector agent. The target must be a valid Uri with the scheme (http or https) and host and may contain a port and a path.
|
||||
|
||||
This is done by configuring an OpenTelemetry [TracerProvider](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/docs/trace/customizing-the-sdk#readme) using extension methods and setting it to auto-start when the host is started.
|
||||
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
|
||||
Once you are done intrumenting your .NET application, you can run it using the below commands
|
||||
|
||||
|
||||
### Step 1: Run OTel Collector
|
||||
Run this command inside the `otelcol-contrib` directory that you created in the install Otel Collector step
|
||||
|
||||
```bash
|
||||
./otelcol-contrib --config ./config.yaml
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Run your .NET application
|
||||
```bash
|
||||
dotnet build
|
||||
dotnet run
|
||||
```
|
||||
@@ -1,70 +0,0 @@
|
||||
|
||||
### Step 1: Install OpenTelemetry Dependencies
|
||||
Dependencies related to OpenTelemetry exporter and SDK have to be installed first.
|
||||
|
||||
Run the below commands after navigating to the application source folder:
|
||||
```bash
|
||||
dotnet add package OpenTelemetry
|
||||
dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol
|
||||
dotnet add package OpenTelemetry.Extensions.Hosting
|
||||
dotnet add package OpenTelemetry.Instrumentation.Runtime
|
||||
dotnet add package OpenTelemetry.Instrumentation.AspNetCore
|
||||
dotnet add package OpenTelemetry.AutoInstrumentation
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Adding OpenTelemetry as a service and configuring exporter options
|
||||
|
||||
In your `Program.cs` file, add OpenTelemetry as a service. Here, we are configuring these variables:
|
||||
|
||||
`serviceName` - It is the name of your service.
|
||||
|
||||
`otlpOptions.Endpoint` - It is the endpoint for your OTel Collector agent.
|
||||
|
||||
|
||||
|
||||
Here’s a sample `Program.cs` file with the configured variables:
|
||||
|
||||
```bash
|
||||
using System.Diagnostics;
|
||||
using OpenTelemetry.Exporter;
|
||||
using OpenTelemetry.Resources;
|
||||
using OpenTelemetry.Trace;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Configure OpenTelemetry with tracing and auto-start.
|
||||
builder.Services.AddOpenTelemetry()
|
||||
.ConfigureResource(resource =>
|
||||
resource.AddService(serviceName: "{{MYAPP}}"))
|
||||
.WithTracing(tracing => tracing
|
||||
.AddAspNetCoreInstrumentation()
|
||||
.AddOtlpExporter(otlpOptions =>
|
||||
{
|
||||
//sigNoz Cloud Endpoint
|
||||
otlpOptions.Endpoint = new Uri("https://ingest.{{REGION}}.signoz.cloud:443");
|
||||
|
||||
otlpOptions.Protocol = OtlpExportProtocol.Grpc;
|
||||
|
||||
//SigNoz Cloud account Ingestion key
|
||||
string headerKey = "signoz-ingestion-key";
|
||||
string headerValue = "{{SIGNOZ_INGESTION_KEY}}";
|
||||
|
||||
string formattedHeader = $"{headerKey}={headerValue}";
|
||||
otlpOptions.Headers = formattedHeader;
|
||||
}));
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
//The index route ("/") is set up to write out the OpenTelemetry trace information on the response:
|
||||
app.MapGet("/", () => $"Hello World! OpenTelemetry Trace: {Activity.Current?.Id}");
|
||||
|
||||
app.Run();
|
||||
```
|
||||
|
||||
|
||||
|
||||
The OpenTelemetry.Exporter.Options get or set the target to which the exporter is going to send traces. Here, we’re configuring it to send traces to the OTel Collector agent. The target must be a valid Uri with the scheme (http or https) and host and may contain a port and a path.
|
||||
|
||||
This is done by configuring an OpenTelemetry [TracerProvider](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/docs/trace/customizing-the-sdk#readme) using extension methods and setting it to auto-start when the host is started.
|
||||
@@ -1,10 +0,0 @@
|
||||
|
||||
To run your .NET application, use the below command :
|
||||
|
||||
```bash
|
||||
dotnet build
|
||||
dotnet run
|
||||
```
|
||||
|
||||
Once you run your .NET application, interact with your application to generate some load and see your application in the SigNoz UI.
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
## Setup OpenTelemetry Binary as an agent
|
||||
|
||||
|
||||
### Step 1: Download otel-collector tar.gz
|
||||
```bash
|
||||
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v{{OTEL_VERSION}}/otelcol-contrib_{{OTEL_VERSION}}_darwin_arm64.tar.gz
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Extract otel-collector tar.gz to the `otelcol-contrib` folder
|
||||
```bash
|
||||
mkdir otelcol-contrib && tar xvzf otelcol-contrib_{{OTEL_VERSION}}_darwin_arm64.tar.gz -C otelcol-contrib
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 3: Create `config.yaml` in folder `otelcol-contrib` with the below content in it
|
||||
```bash
|
||||
receivers:
|
||||
otlp:
|
||||
protocols:
|
||||
grpc:
|
||||
endpoint: 0.0.0.0:4317
|
||||
http:
|
||||
endpoint: 0.0.0.0:4318
|
||||
hostmetrics:
|
||||
collection_interval: 60s
|
||||
scrapers:
|
||||
cpu: {}
|
||||
disk: {}
|
||||
load: {}
|
||||
filesystem: {}
|
||||
memory: {}
|
||||
network: {}
|
||||
paging: {}
|
||||
process:
|
||||
mute_process_name_error: true
|
||||
mute_process_exe_error: true
|
||||
mute_process_io_error: true
|
||||
processes: {}
|
||||
prometheus:
|
||||
config:
|
||||
global:
|
||||
scrape_interval: 60s
|
||||
scrape_configs:
|
||||
- job_name: otel-collector-binary
|
||||
static_configs:
|
||||
- targets:
|
||||
# - localhost:8888
|
||||
processors:
|
||||
batch:
|
||||
send_batch_size: 1000
|
||||
timeout: 10s
|
||||
# Ref: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/resourcedetectionprocessor/README.md
|
||||
resourcedetection:
|
||||
detectors: [env, system] # Before system detector, include ec2 for AWS, gcp for GCP and azure for Azure.
|
||||
# Using OTEL_RESOURCE_ATTRIBUTES envvar, env detector adds custom labels.
|
||||
timeout: 2s
|
||||
system:
|
||||
hostname_sources: [os] # alternatively, use [dns,os] for setting FQDN as host.name and os as fallback
|
||||
extensions:
|
||||
health_check: {}
|
||||
zpages: {}
|
||||
exporters:
|
||||
otlp:
|
||||
endpoint: "ingest.{{REGION}}.signoz.cloud:443"
|
||||
tls:
|
||||
insecure: false
|
||||
headers:
|
||||
"signoz-ingestion-key": "{{SIGNOZ_INGESTION_KEY}}"
|
||||
logging:
|
||||
verbosity: normal
|
||||
service:
|
||||
telemetry:
|
||||
metrics:
|
||||
address: 0.0.0.0:8888
|
||||
extensions: [health_check, zpages]
|
||||
pipelines:
|
||||
metrics:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
metrics/internal:
|
||||
receivers: [prometheus, hostmetrics]
|
||||
processors: [resourcedetection, batch]
|
||||
exporters: [otlp]
|
||||
traces:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
logs:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
```
|
||||
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
After setting up the Otel collector agent, follow the steps below to instrument your .NET Application
|
||||
|
||||
|
||||
|
||||
|
||||
### Step 1: Install OpenTelemetry Dependencies
|
||||
Install the following dependencies in your application.
|
||||
|
||||
```bash
|
||||
dotnet add package OpenTelemetry
|
||||
dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol
|
||||
dotnet add package OpenTelemetry.Extensions.Hosting
|
||||
dotnet add package OpenTelemetry.Instrumentation.Runtime
|
||||
dotnet add package OpenTelemetry.Instrumentation.AspNetCore
|
||||
dotnet add package OpenTelemetry.AutoInstrumentation
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Adding OpenTelemetry as a service and configuring exporter options
|
||||
|
||||
In your `Program.cs` file, add OpenTelemetry as a service. Here, we are configuring these variables:
|
||||
|
||||
`serviceName` - It is the name of your service.
|
||||
|
||||
`otlpOptions.Endpoint` - It is the endpoint for your OTel Collector agent.
|
||||
|
||||
|
||||
|
||||
Here’s a sample `Program.cs` file with the configured variables:
|
||||
|
||||
```bash
|
||||
using System.Diagnostics;
|
||||
using OpenTelemetry.Exporter;
|
||||
using OpenTelemetry.Resources;
|
||||
using OpenTelemetry.Trace;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Configure OpenTelemetry with tracing and auto-start.
|
||||
builder.Services.AddOpenTelemetry()
|
||||
.ConfigureResource(resource =>
|
||||
resource.AddService(serviceName: "{{MYAPP}}"))
|
||||
.WithTracing(tracing => tracing
|
||||
.AddAspNetCoreInstrumentation()
|
||||
.AddOtlpExporter(otlpOptions =>
|
||||
{
|
||||
otlpOptions.Endpoint = new Uri("http://localhost:4317");
|
||||
|
||||
otlpOptions.Protocol = OtlpExportProtocol.Grpc;
|
||||
}));
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
//The index route ("/") is set up to write out the OpenTelemetry trace information on the response:
|
||||
app.MapGet("/", () => $"Hello World! OpenTelemetry Trace: {Activity.Current?.Id}");
|
||||
|
||||
app.Run();
|
||||
```
|
||||
|
||||
|
||||
|
||||
The OpenTelemetry.Exporter.Options get or set the target to which the exporter is going to send traces. Here, we’re configuring it to send traces to the OTel Collector agent. The target must be a valid Uri with the scheme (http or https) and host and may contain a port and a path.
|
||||
|
||||
This is done by configuring an OpenTelemetry [TracerProvider](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/docs/trace/customizing-the-sdk#readme) using extension methods and setting it to auto-start when the host is started.
|
||||
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
|
||||
Once you are done intrumenting your .NET application, you can run it using the below commands
|
||||
|
||||
|
||||
### Step 1: Run OTel Collector
|
||||
Run this command inside the `otelcol-contrib` directory that you created in the install Otel Collector step
|
||||
|
||||
```bash
|
||||
./otelcol-contrib --config ./config.yaml
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Run your .NET application
|
||||
```bash
|
||||
dotnet build
|
||||
dotnet run
|
||||
```
|
||||
@@ -1,67 +0,0 @@
|
||||
**Step 1: Installing the OpenTelemetry dependency packages:**
|
||||
|
||||
```bash
|
||||
dotnet add package OpenTelemetry
|
||||
dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol
|
||||
dotnet add package OpenTelemetry.Extensions.Hosting
|
||||
dotnet add package OpenTelemetry.Instrumentation.Runtime
|
||||
dotnet add package OpenTelemetry.Instrumentation.AspNetCore
|
||||
dotnet add package OpenTelemetry.AutoInstrumentation
|
||||
```
|
||||
|
||||
**Step 2: Adding OpenTelemetry as a service and configuring exporter options in `Program.cs`:**
|
||||
|
||||
In your `Program.cs` file, add OpenTelemetry as a service.
|
||||
|
||||
Here’s a sample `Program.cs` file with the configured variables.
|
||||
|
||||
```bash
|
||||
using System.Diagnostics;
|
||||
using OpenTelemetry.Exporter;
|
||||
using OpenTelemetry.Resources;
|
||||
using OpenTelemetry.Trace;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Configure OpenTelemetry with tracing and auto-start.
|
||||
builder.Services.AddOpenTelemetry()
|
||||
.ConfigureResource(resource =>
|
||||
resource.AddService(serviceName: "{{MYAPP}}"))
|
||||
.WithTracing(tracing => tracing
|
||||
.AddAspNetCoreInstrumentation()
|
||||
.AddOtlpExporter(otlpOptions =>
|
||||
{
|
||||
//SigNoz Cloud Endpoint
|
||||
otlpOptions.Endpoint = new Uri("https://ingest.{{REGION}}.signoz.cloud:443");
|
||||
|
||||
otlpOptions.Protocol = OtlpExportProtocol.Grpc;
|
||||
|
||||
//SigNoz Cloud account Ingestion key
|
||||
string headerKey = "signoz-ingestion-key";
|
||||
string headerValue = "{{SIGNOZ_INGESTION_KEY}}";
|
||||
|
||||
string formattedHeader = $"{headerKey}={headerValue}";
|
||||
otlpOptions.Headers = formattedHeader;
|
||||
}));
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// The index route ("/") is set up to write out the OpenTelemetry trace information on the response:
|
||||
app.MapGet("/", () => $"Hello World! OpenTelemetry Trace: {Activity.Current?.Id}");
|
||||
|
||||
app.Run();
|
||||
```
|
||||
|
||||
|
||||
**Step 3. Running the .NET application:**
|
||||
|
||||
```bash
|
||||
dotnet build
|
||||
dotnet run
|
||||
```
|
||||
|
||||
**Step 4: Generating some load data and checking your application in SigNoz UI**
|
||||
|
||||
Once your application is running, generate some traffic by interacting with it.
|
||||
|
||||
In the SigNoz account, open the `Services` tab. Hit the `Refresh` button on the top right corner, and your application should appear in the list of `Applications`. Ensure that you're checking data for the `time range filter` applied in the top right corner. You might have to wait for a few seconds before the data appears on SigNoz UI.
|
||||
@@ -1,10 +0,0 @@
|
||||
|
||||
To run your .NET application, use the below command :
|
||||
|
||||
```bash
|
||||
dotnet build
|
||||
dotnet run
|
||||
```
|
||||
|
||||
Once you run your .NET application, interact with your application to generate some load and see your application in the SigNoz UI.
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
## Setup OpenTelemetry Binary as an agent
|
||||
|
||||
|
||||
|
||||
As a first step, you should install the OTel collector Binary according to the instructions provided on [this link](https://signoz.io/docs/tutorial/opentelemetry-binary-usage-in-virtual-machine/).
|
||||
|
||||
|
||||
|
||||
Once you are done setting up the OTel collector binary, you can follow the next steps.
|
||||
|
||||
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
After setting up the Otel collector agent, follow the steps below to instrument your .NET Application
|
||||
|
||||
|
||||
|
||||
|
||||
### Step 1: Install OpenTelemetry Dependencies
|
||||
Install the following dependencies in your application.
|
||||
|
||||
```bash
|
||||
dotnet add package OpenTelemetry
|
||||
dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol
|
||||
dotnet add package OpenTelemetry.Extensions.Hosting
|
||||
dotnet add package OpenTelemetry.Instrumentation.Runtime
|
||||
dotnet add package OpenTelemetry.Instrumentation.AspNetCore
|
||||
dotnet add package OpenTelemetry.AutoInstrumentation
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Adding OpenTelemetry as a service and configuring exporter options
|
||||
|
||||
In your `Program.cs` file, add OpenTelemetry as a service. Here, we are configuring these variables:
|
||||
|
||||
|
||||
|
||||
Here’s a sample `Program.cs` file with the configured variables:
|
||||
|
||||
```bash
|
||||
using System.Diagnostics;
|
||||
using OpenTelemetry.Exporter;
|
||||
using OpenTelemetry.Resources;
|
||||
using OpenTelemetry.Trace;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Configure OpenTelemetry with tracing and auto-start.
|
||||
builder.Services.AddOpenTelemetry()
|
||||
.ConfigureResource(resource =>
|
||||
resource.AddService(serviceName: "{{MYAPP}}"))
|
||||
.WithTracing(tracing => tracing
|
||||
.AddAspNetCoreInstrumentation()
|
||||
.AddOtlpExporter(otlpOptions =>
|
||||
{
|
||||
otlpOptions.Endpoint = new Uri("http://localhost:4317");
|
||||
|
||||
otlpOptions.Protocol = OtlpExportProtocol.Grpc;
|
||||
}));
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
//The index route ("/") is set up to write out the OpenTelemetry trace information on the response:
|
||||
app.MapGet("/", () => $"Hello World! OpenTelemetry Trace: {Activity.Current?.Id}");
|
||||
|
||||
app.Run();
|
||||
```
|
||||
|
||||
|
||||
The OpenTelemetry.Exporter.Options get or set the target to which the exporter is going to send traces. Here, we’re configuring it to send traces to the OTel Collector agent. The target must be a valid Uri with the scheme (http or https) and host and may contain a port and a path.
|
||||
|
||||
This is done by configuring an OpenTelemetry [TracerProvider](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/docs/trace/customizing-the-sdk#readme) using extension methods and setting it to auto-start when the host is started.
|
||||
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
|
||||
Once you are done intrumenting your .NET application, you can run it using the below commands
|
||||
|
||||
|
||||
### Step 1: Run OTel Collector
|
||||
Run this command inside the `otelcol-contrib` directory that you created in the install Otel Collector step
|
||||
|
||||
```bash
|
||||
./otelcol-contrib --config ./config.yaml
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Run your .NET application
|
||||
```bash
|
||||
dotnet build
|
||||
dotnet run
|
||||
```
|
||||
@@ -1,67 +0,0 @@
|
||||
|
||||
|
||||
Follow the steps below to instrument your Elixir (Phoenix + Ecto) Application
|
||||
|
||||
### Step 1: Add dependencies
|
||||
Install dependencies related to OpenTelemetry by adding them to `mix.exs` file
|
||||
|
||||
```bash
|
||||
{:opentelemetry_exporter, "~> 1.6"},
|
||||
{:opentelemetry_api, "~> 1.2"},
|
||||
{:opentelemetry, "~> 1.3"},
|
||||
{:opentelemetry_semantic_conventions, "~> 0.2"},
|
||||
{:opentelemetry_cowboy, "~> 0.2.1"},
|
||||
{:opentelemetry_phoenix, "~> 1.1"},
|
||||
{:opentelemetry_ecto, "~> 1.1"}
|
||||
```
|
||||
|
||||
|
||||
In your application start, usually the `application.ex` file, setup the telemetry handlers
|
||||
|
||||
```bash
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:{{MYAPP}}, :repo])
|
||||
```
|
||||
|
||||
|
||||
As an example, this is how you can setup the handlers in your application.ex file for an application called demo :
|
||||
|
||||
```bash
|
||||
# application.ex
|
||||
@impl true
|
||||
def start(_type, _args) do
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:demo, :repo])
|
||||
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Configure Application
|
||||
You need to configure your application to send telemetry data by adding the following config to your `runtime.exs` file:
|
||||
|
||||
```bash
|
||||
config :opentelemetry, :resource, service: %{name: "{{MYAPP}}"}
|
||||
|
||||
config :opentelemetry, :processors,
|
||||
otel_batch_processor: %{
|
||||
exporter: {
|
||||
:opentelemetry_exporter,
|
||||
%{
|
||||
endpoints: ["https://ingest.{{REGION}}.signoz.cloud:443"],
|
||||
headers: [
|
||||
{"signoz-ingestion-key", {{SIGNOZ_ACCESS_TOKEN}} }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 3: Dockerize your application
|
||||
|
||||
Since the environment variables like SIGNOZ_INGESTION_KEY, Ingestion Endpoint and Service name are set in the above steps, you don't need to add any additional steps in your Dockerfile.
|
||||
@@ -1,25 +0,0 @@
|
||||
Once you update your Dockerfile, you can build and run it using the commands below.
|
||||
|
||||
|
||||
|
||||
### Step 1: Build your dockerfile
|
||||
|
||||
Build your docker image
|
||||
|
||||
```bash
|
||||
docker build -t <your-image-name> .
|
||||
```
|
||||
|
||||
- `<your-image-name>` is the name of your Docker Image
|
||||
|
||||
|
||||
|
||||
### Step 2: Run your docker image
|
||||
|
||||
```bash
|
||||
docker run <your-image-name>
|
||||
```
|
||||
|
||||
|
||||
|
||||
To see some examples for instrumented applications, you can checkout [this link](https://signoz.io/docs/instrumentation/elixir/#sample-examples)
|
||||
@@ -1,12 +0,0 @@
|
||||
## Setup OpenTelemetry Binary as an agent
|
||||
|
||||
|
||||
|
||||
As a first step, you should install the OTel collector Binary according to the instructions provided on [this link](https://signoz.io/docs/tutorial/opentelemetry-binary-usage-in-virtual-machine/).
|
||||
|
||||
|
||||
|
||||
Once you are done setting up the OTel collector binary, you can follow the next steps.
|
||||
|
||||
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
|
||||
|
||||
After setting up the Otel collector agent, follow the steps below to instrument your Elixir (Phoenix + Ecto) Application
|
||||
|
||||
### Step 1: Add dependencies
|
||||
Install dependencies related to OpenTelemetry by adding them to `mix.exs` file
|
||||
|
||||
```bash
|
||||
{:opentelemetry_exporter, "~> 1.6"},
|
||||
{:opentelemetry_api, "~> 1.2"},
|
||||
{:opentelemetry, "~> 1.3"},
|
||||
{:opentelemetry_semantic_conventions, "~> 0.2"},
|
||||
{:opentelemetry_cowboy, "~> 0.2.1"},
|
||||
{:opentelemetry_phoenix, "~> 1.1"},
|
||||
{:opentelemetry_ecto, "~> 1.1"}
|
||||
```
|
||||
|
||||
|
||||
In your application start, usually the `application.ex` file, setup the telemetry handlers
|
||||
|
||||
```bash
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:{{MYAPP}}, :repo])
|
||||
```
|
||||
|
||||
|
||||
As an example, this is how you can setup the handlers in your application.ex file for an application called demo :
|
||||
|
||||
```bash
|
||||
# application.ex
|
||||
@impl true
|
||||
def start(_type, _args) do
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:demo, :repo])
|
||||
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Configure Application
|
||||
You need to configure your application to send telemetry data by adding the following config to your `runtime.exs` file:
|
||||
|
||||
```bash
|
||||
config :opentelemetry, :resource, service: %{name: "{{MYAPP}}"}
|
||||
|
||||
config :opentelemetry, :processors,
|
||||
otel_batch_processor: %{
|
||||
exporter:
|
||||
{:opentelemetry_exporter,
|
||||
%{endpoints: ["http://localhost:4318"]}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Step 3: Dockerize your application
|
||||
|
||||
Since the environment variables like SIGNOZ_INGESTION_KEY, Ingestion Endpoint and Service name are set in the above steps, you don't need to add any additional steps in your Dockerfile.
|
||||
@@ -1,25 +0,0 @@
|
||||
Once you update your Dockerfile, you can build and run it using the commands below.
|
||||
|
||||
|
||||
|
||||
### Step 1: Build your dockerfile
|
||||
|
||||
Build your docker image
|
||||
|
||||
```bash
|
||||
docker build -t <your-image-name> .
|
||||
```
|
||||
|
||||
- `<your-image-name>` is the name of your Docker Image
|
||||
|
||||
|
||||
|
||||
### Step 2: Run your docker image
|
||||
|
||||
```bash
|
||||
docker run <your-image-name>
|
||||
```
|
||||
|
||||
|
||||
|
||||
To see some examples for instrumented applications, you can checkout [this link](https://signoz.io/docs/instrumentation/elixir/#sample-examples)
|
||||
@@ -1,43 +0,0 @@
|
||||
### Install otel-collector in your Kubernetes infra
|
||||
|
||||
Add the SigNoz Helm Chart repository
|
||||
```bash
|
||||
helm repo add signoz https://charts.signoz.io
|
||||
```
|
||||
|
||||
|
||||
|
||||
If the chart is already present, update the chart to the latest using:
|
||||
```bash
|
||||
helm repo update
|
||||
```
|
||||
|
||||
|
||||
|
||||
For generic Kubernetes clusters, you can create *override-values.yaml* with the following configuration:
|
||||
|
||||
```yaml
|
||||
global:
|
||||
cloud: others
|
||||
clusterName: <CLUSTER_NAME>
|
||||
deploymentEnvironment: <DEPLOYMENT_ENVIRONMENT>
|
||||
otelCollectorEndpoint: ingest.{{REGION}}.signoz.cloud:443
|
||||
otelInsecure: false
|
||||
signozApiKey: {{SIGNOZ_INGESTION_KEY}}
|
||||
presets:
|
||||
otlpExporter:
|
||||
enabled: true
|
||||
loggingExporter:
|
||||
enabled: false
|
||||
```
|
||||
|
||||
- Replace `<CLUSTER_NAME>` with the name of the Kubernetes cluster or a unique identifier of the cluster.
|
||||
- Replace `<DEPLOYMENT_ENVIRONMENT>` with the deployment environment of your application. Example: **"staging"**, **"production"**, etc.
|
||||
|
||||
|
||||
|
||||
To install the k8s-infra chart with the above configuration, run the following command:
|
||||
|
||||
```bash
|
||||
helm install my-release signoz/k8s-infra -f override-values.yaml
|
||||
```
|
||||
@@ -1,57 +0,0 @@
|
||||
|
||||
|
||||
After setting up the Otel collector agent, follow the steps below to instrument your Elixir (Phoenix + Ecto) Application
|
||||
|
||||
### Step 1: Add dependencies
|
||||
Install dependencies related to OpenTelemetry by adding them to `mix.exs` file
|
||||
|
||||
```bash
|
||||
{:opentelemetry_exporter, "~> 1.6"},
|
||||
{:opentelemetry_api, "~> 1.2"},
|
||||
{:opentelemetry, "~> 1.3"},
|
||||
{:opentelemetry_semantic_conventions, "~> 0.2"},
|
||||
{:opentelemetry_cowboy, "~> 0.2.1"},
|
||||
{:opentelemetry_phoenix, "~> 1.1"},
|
||||
{:opentelemetry_ecto, "~> 1.1"}
|
||||
```
|
||||
|
||||
|
||||
In your application start, usually the `application.ex` file, setup the telemetry handlers
|
||||
|
||||
```bash
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:{{MYAPP}}, :repo])
|
||||
```
|
||||
|
||||
|
||||
As an example, this is how you can setup the handlers in your application.ex file for an application called demo :
|
||||
|
||||
```bash
|
||||
# application.ex
|
||||
@impl true
|
||||
def start(_type, _args) do
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:demo, :repo])
|
||||
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Configure Application
|
||||
You need to configure your application to send telemetry data by adding the following config to your `runtime.exs` file:
|
||||
|
||||
```bash
|
||||
config :opentelemetry, :resource, service: %{name: "{{MYAPP}}"}
|
||||
|
||||
config :opentelemetry, :processors,
|
||||
otel_batch_processor: %{
|
||||
exporter:
|
||||
{:opentelemetry_exporter,
|
||||
%{endpoints: ["http://localhost:4318"]}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
### Running your Elixir application
|
||||
Once you are done instrumenting your Elixir (Phoenix + Ecto) application with OpenTelemetry, you should install the dependencies needed to run your application and run it as you normally would.
|
||||
|
||||
|
||||
|
||||
To see some examples for instrumented applications, you can checkout [this link](https://signoz.io/docs/instrumentation/elixir/#sample-examples)
|
||||
@@ -1,62 +0,0 @@
|
||||
|
||||
|
||||
Follow the steps below to instrument your Elixir (Phoenix + Ecto) Application
|
||||
|
||||
### Step 1: Add dependencies
|
||||
Install dependencies related to OpenTelemetry by adding them to `mix.exs` file
|
||||
|
||||
```bash
|
||||
{:opentelemetry_exporter, "~> 1.6"},
|
||||
{:opentelemetry_api, "~> 1.2"},
|
||||
{:opentelemetry, "~> 1.3"},
|
||||
{:opentelemetry_semantic_conventions, "~> 0.2"},
|
||||
{:opentelemetry_cowboy, "~> 0.2.1"},
|
||||
{:opentelemetry_phoenix, "~> 1.1"},
|
||||
{:opentelemetry_ecto, "~> 1.1"}
|
||||
```
|
||||
|
||||
|
||||
In your application start, usually the `application.ex` file, setup the telemetry handlers
|
||||
|
||||
```bash
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:{{MYAPP}}, :repo])
|
||||
```
|
||||
|
||||
|
||||
As an example, this is how you can setup the handlers in your application.ex file for an application called demo :
|
||||
|
||||
```bash
|
||||
# application.ex
|
||||
@impl true
|
||||
def start(_type, _args) do
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:demo, :repo])
|
||||
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Configure Application
|
||||
You need to configure your application to send telemetry data by adding the following config to your `runtime.exs` file:
|
||||
|
||||
```bash
|
||||
config :opentelemetry, :resource, service: %{name: "{{MYAPP}}"}
|
||||
|
||||
config :opentelemetry, :processors,
|
||||
otel_batch_processor: %{
|
||||
exporter: {
|
||||
:opentelemetry_exporter,
|
||||
%{
|
||||
endpoints: ["https://ingest.{{REGION}}.signoz.cloud:443"],
|
||||
headers: [
|
||||
{"signoz-ingestion-key", {{SIGNOZ_ACCESS_TOKEN}} }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
### Running your Elixir application
|
||||
Once you are done instrumenting your Elixir (Phoenix + Ecto) application with OpenTelemetry, you should install the dependencies needed to run your application and run it as you normally would.
|
||||
|
||||
|
||||
|
||||
To see some examples for instrumented applications, you can checkout [this link](https://signoz.io/docs/instrumentation/elixir/#sample-examples)
|
||||
@@ -1,96 +0,0 @@
|
||||
## Setup OpenTelemetry Binary as an agent
|
||||
|
||||
|
||||
### Step 1: Download otel-collector tar.gz
|
||||
```bash
|
||||
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v{{OTEL_VERSION}}/otelcol-contrib_{{OTEL_VERSION}}_linux_amd64.tar.gz
|
||||
```
|
||||
|
||||
|
||||
### Step 2: Extract otel-collector tar.gz to the `otelcol-contrib` folder
|
||||
```bash
|
||||
mkdir otelcol-contrib && tar xvzf otelcol-contrib_{{OTEL_VERSION}}_linux_amd64.tar.gz -C otelcol-contrib
|
||||
```
|
||||
|
||||
|
||||
### Step 3: Create config.yaml in folder otelcol-contrib with the below content in it
|
||||
```bash
|
||||
receivers:
|
||||
otlp:
|
||||
protocols:
|
||||
grpc:
|
||||
endpoint: 0.0.0.0:4317
|
||||
http:
|
||||
endpoint: 0.0.0.0:4318
|
||||
hostmetrics:
|
||||
collection_interval: 60s
|
||||
scrapers:
|
||||
cpu: {}
|
||||
disk: {}
|
||||
load: {}
|
||||
filesystem: {}
|
||||
memory: {}
|
||||
network: {}
|
||||
paging: {}
|
||||
process:
|
||||
mute_process_name_error: true
|
||||
mute_process_exe_error: true
|
||||
mute_process_io_error: true
|
||||
processes: {}
|
||||
prometheus:
|
||||
config:
|
||||
global:
|
||||
scrape_interval: 60s
|
||||
scrape_configs:
|
||||
- job_name: otel-collector-binary
|
||||
static_configs:
|
||||
- targets:
|
||||
# - localhost:8888
|
||||
processors:
|
||||
batch:
|
||||
send_batch_size: 1000
|
||||
timeout: 10s
|
||||
# Ref: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/resourcedetectionprocessor/README.md
|
||||
resourcedetection:
|
||||
detectors: [env, system] # Before system detector, include ec2 for AWS, gcp for GCP and azure for Azure.
|
||||
# Using OTEL_RESOURCE_ATTRIBUTES envvar, env detector adds custom labels.
|
||||
timeout: 2s
|
||||
system:
|
||||
hostname_sources: [os] # alternatively, use [dns,os] for setting FQDN as host.name and os as fallback
|
||||
extensions:
|
||||
health_check: {}
|
||||
zpages: {}
|
||||
exporters:
|
||||
otlp:
|
||||
endpoint: "ingest.{{REGION}}.signoz.cloud:443"
|
||||
tls:
|
||||
insecure: false
|
||||
headers:
|
||||
"signoz-ingestion-key": "{{SIGNOZ_INGESTION_KEY}}"
|
||||
logging:
|
||||
verbosity: normal
|
||||
service:
|
||||
telemetry:
|
||||
metrics:
|
||||
address: 0.0.0.0:8888
|
||||
extensions: [health_check, zpages]
|
||||
pipelines:
|
||||
metrics:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
metrics/internal:
|
||||
receivers: [prometheus, hostmetrics]
|
||||
processors: [resourcedetection, batch]
|
||||
exporters: [otlp]
|
||||
traces:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
logs:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
```
|
||||
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
|
||||
|
||||
After setting up the Otel collector agent, follow the steps below to instrument your Elixir (Phoenix + Ecto) Application
|
||||
|
||||
### Step 1: Add dependencies
|
||||
Install dependencies related to OpenTelemetry by adding them to `mix.exs` file
|
||||
|
||||
```bash
|
||||
{:opentelemetry_exporter, "~> 1.6"},
|
||||
{:opentelemetry_api, "~> 1.2"},
|
||||
{:opentelemetry, "~> 1.3"},
|
||||
{:opentelemetry_semantic_conventions, "~> 0.2"},
|
||||
{:opentelemetry_cowboy, "~> 0.2.1"},
|
||||
{:opentelemetry_phoenix, "~> 1.1"},
|
||||
{:opentelemetry_ecto, "~> 1.1"}
|
||||
```
|
||||
|
||||
|
||||
In your application start, usually the `application.ex` file, setup the telemetry handlers
|
||||
|
||||
```bash
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:{{MYAPP}}, :repo])
|
||||
```
|
||||
|
||||
|
||||
As an example, this is how you can setup the handlers in your application.ex file for an application called demo :
|
||||
|
||||
```bash
|
||||
# application.ex
|
||||
@impl true
|
||||
def start(_type, _args) do
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:demo, :repo])
|
||||
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Configure Application
|
||||
You need to configure your application to send telemetry data by adding the following config to your `runtime.exs` file:
|
||||
|
||||
```bash
|
||||
config :opentelemetry, :resource, service: %{name: "{{MYAPP}}"}
|
||||
|
||||
config :opentelemetry, :processors,
|
||||
otel_batch_processor: %{
|
||||
exporter:
|
||||
{:opentelemetry_exporter,
|
||||
%{endpoints: ["http://localhost:4318"]}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
|
||||
|
||||
### Step 1: Run OTel Collector
|
||||
Run this command inside the `otelcol-contrib` directory that you created in the install Otel Collector step
|
||||
|
||||
```bash
|
||||
./otelcol-contrib --config ./config.yaml &> otelcol-output.log & echo "$!" > otel-pid
|
||||
```
|
||||
|
||||
|
||||
#### (Optional Step): View last 50 lines of `otelcol` logs
|
||||
```bash
|
||||
tail -f -n 50 otelcol-output.log
|
||||
```
|
||||
|
||||
#### (Optional Step): Stop `otelcol`
|
||||
```bash
|
||||
kill "$(< otel-pid)"
|
||||
```
|
||||
|
||||
|
||||
### Step 2: Running your Elixir application
|
||||
|
||||
Once you are done instrumenting your Elixir (Phoenix + Ecto) application with OpenTelemetry, you should install the dependencies needed to run your application and run it as you normally would.
|
||||
|
||||
|
||||
|
||||
To see some examples for instrumented applications, you can checkout [this link](https://signoz.io/docs/instrumentation/elixir/#sample-examples)
|
||||
```
|
||||
@@ -1,62 +0,0 @@
|
||||
|
||||
|
||||
Follow the steps below to instrument your Elixir (Phoenix + Ecto) Application
|
||||
|
||||
### Step 1: Add dependencies
|
||||
Install dependencies related to OpenTelemetry by adding them to `mix.exs` file
|
||||
|
||||
```bash
|
||||
{:opentelemetry_exporter, "~> 1.6"},
|
||||
{:opentelemetry_api, "~> 1.2"},
|
||||
{:opentelemetry, "~> 1.3"},
|
||||
{:opentelemetry_semantic_conventions, "~> 0.2"},
|
||||
{:opentelemetry_cowboy, "~> 0.2.1"},
|
||||
{:opentelemetry_phoenix, "~> 1.1"},
|
||||
{:opentelemetry_ecto, "~> 1.1"}
|
||||
```
|
||||
|
||||
|
||||
In your application start, usually the `application.ex` file, setup the telemetry handlers
|
||||
|
||||
```bash
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:{{MYAPP}}, :repo])
|
||||
```
|
||||
|
||||
|
||||
As an example, this is how you can setup the handlers in your application.ex file for an application called demo :
|
||||
|
||||
```bash
|
||||
# application.ex
|
||||
@impl true
|
||||
def start(_type, _args) do
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:demo, :repo])
|
||||
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Configure Application
|
||||
You need to configure your application to send telemetry data by adding the following config to your `runtime.exs` file:
|
||||
|
||||
```bash
|
||||
config :opentelemetry, :resource, service: %{name: "{{MYAPP}}"}
|
||||
|
||||
config :opentelemetry, :processors,
|
||||
otel_batch_processor: %{
|
||||
exporter: {
|
||||
:opentelemetry_exporter,
|
||||
%{
|
||||
endpoints: ["https://ingest.{{REGION}}.signoz.cloud:443"],
|
||||
headers: [
|
||||
{"signoz-ingestion-key", {{SIGNOZ_ACCESS_TOKEN}} }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
### Running your Elixir application
|
||||
Once you are done instrumenting your Elixir (Phoenix + Ecto) application with OpenTelemetry, you should install the dependencies needed to run your application and run it as you normally would.
|
||||
|
||||
|
||||
|
||||
To see some examples for instrumented applications, you can checkout [this link](https://signoz.io/docs/instrumentation/elixir/#sample-examples)
|
||||
@@ -1,96 +0,0 @@
|
||||
## Setup OpenTelemetry Binary as an agent
|
||||
|
||||
|
||||
### Step 1: Download otel-collector tar.gz
|
||||
```bash
|
||||
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v{{OTEL_VERSION}}/otelcol-contrib_{{OTEL_VERSION}}_linux_arm64.tar.gz
|
||||
```
|
||||
|
||||
|
||||
### Step 2: Extract otel-collector tar.gz to the `otelcol-contrib` folder
|
||||
```bash
|
||||
mkdir otelcol-contrib && tar xvzf otelcol-contrib_{{OTEL_VERSION}}_linux_arm64.tar.gz -C otelcol-contrib
|
||||
```
|
||||
|
||||
|
||||
### Step 3: Create config.yaml in folder otelcol-contrib with the below content in it
|
||||
```bash
|
||||
receivers:
|
||||
otlp:
|
||||
protocols:
|
||||
grpc:
|
||||
endpoint: 0.0.0.0:4317
|
||||
http:
|
||||
endpoint: 0.0.0.0:4318
|
||||
hostmetrics:
|
||||
collection_interval: 60s
|
||||
scrapers:
|
||||
cpu: {}
|
||||
disk: {}
|
||||
load: {}
|
||||
filesystem: {}
|
||||
memory: {}
|
||||
network: {}
|
||||
paging: {}
|
||||
process:
|
||||
mute_process_name_error: true
|
||||
mute_process_exe_error: true
|
||||
mute_process_io_error: true
|
||||
processes: {}
|
||||
prometheus:
|
||||
config:
|
||||
global:
|
||||
scrape_interval: 60s
|
||||
scrape_configs:
|
||||
- job_name: otel-collector-binary
|
||||
static_configs:
|
||||
- targets:
|
||||
# - localhost:8888
|
||||
processors:
|
||||
batch:
|
||||
send_batch_size: 1000
|
||||
timeout: 10s
|
||||
# Ref: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/resourcedetectionprocessor/README.md
|
||||
resourcedetection:
|
||||
detectors: [env, system] # Before system detector, include ec2 for AWS, gcp for GCP and azure for Azure.
|
||||
# Using OTEL_RESOURCE_ATTRIBUTES envvar, env detector adds custom labels.
|
||||
timeout: 2s
|
||||
system:
|
||||
hostname_sources: [os] # alternatively, use [dns,os] for setting FQDN as host.name and os as fallback
|
||||
extensions:
|
||||
health_check: {}
|
||||
zpages: {}
|
||||
exporters:
|
||||
otlp:
|
||||
endpoint: "ingest.{{REGION}}.signoz.cloud:443"
|
||||
tls:
|
||||
insecure: false
|
||||
headers:
|
||||
"signoz-ingestion-key": "{{SIGNOZ_INGESTION_KEY}}"
|
||||
logging:
|
||||
verbosity: normal
|
||||
service:
|
||||
telemetry:
|
||||
metrics:
|
||||
address: 0.0.0.0:8888
|
||||
extensions: [health_check, zpages]
|
||||
pipelines:
|
||||
metrics:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
metrics/internal:
|
||||
receivers: [prometheus, hostmetrics]
|
||||
processors: [resourcedetection, batch]
|
||||
exporters: [otlp]
|
||||
traces:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
logs:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
```
|
||||
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
|
||||
|
||||
After setting up the Otel collector agent, follow the steps below to instrument your Elixir (Phoenix + Ecto) Application
|
||||
|
||||
### Step 1: Add dependencies
|
||||
Install dependencies related to OpenTelemetry by adding them to `mix.exs` file
|
||||
|
||||
```bash
|
||||
{:opentelemetry_exporter, "~> 1.6"},
|
||||
{:opentelemetry_api, "~> 1.2"},
|
||||
{:opentelemetry, "~> 1.3"},
|
||||
{:opentelemetry_semantic_conventions, "~> 0.2"},
|
||||
{:opentelemetry_cowboy, "~> 0.2.1"},
|
||||
{:opentelemetry_phoenix, "~> 1.1"},
|
||||
{:opentelemetry_ecto, "~> 1.1"}
|
||||
```
|
||||
|
||||
|
||||
In your application start, usually the `application.ex` file, setup the telemetry handlers
|
||||
|
||||
```bash
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:{{MYAPP}}, :repo])
|
||||
```
|
||||
|
||||
|
||||
As an example, this is how you can setup the handlers in your application.ex file for an application called demo :
|
||||
|
||||
```bash
|
||||
# application.ex
|
||||
@impl true
|
||||
def start(_type, _args) do
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:demo, :repo])
|
||||
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Configure Application
|
||||
You need to configure your application to send telemetry data by adding the following config to your `runtime.exs` file:
|
||||
|
||||
```bash
|
||||
config :opentelemetry, :resource, service: %{name: "{{MYAPP}}"}
|
||||
|
||||
config :opentelemetry, :processors,
|
||||
otel_batch_processor: %{
|
||||
exporter:
|
||||
{:opentelemetry_exporter,
|
||||
%{endpoints: ["http://localhost:4318"]}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
|
||||
|
||||
### Step 1: Run OTel Collector
|
||||
Run this command inside the `otelcol-contrib` directory that you created in the install Otel Collector step
|
||||
|
||||
```bash
|
||||
./otelcol-contrib --config ./config.yaml &> otelcol-output.log & echo "$!" > otel-pid
|
||||
```
|
||||
|
||||
|
||||
#### (Optional Step): View last 50 lines of `otelcol` logs
|
||||
```bash
|
||||
tail -f -n 50 otelcol-output.log
|
||||
```
|
||||
|
||||
#### (Optional Step): Stop `otelcol`
|
||||
```bash
|
||||
kill "$(< otel-pid)"
|
||||
```
|
||||
|
||||
|
||||
### Step 2: Running your Elixir application
|
||||
Once you are done instrumenting your Elixir (Phoenix + Ecto) application with OpenTelemetry, you should install the dependencies needed to run your application and run it as you normally would.
|
||||
|
||||
|
||||
|
||||
To see some examples for instrumented applications, you can checkout [this link](https://signoz.io/docs/instrumentation/elixir/#sample-examples)
|
||||
```
|
||||
@@ -1,62 +0,0 @@
|
||||
|
||||
|
||||
Follow the steps below to instrument your Elixir (Phoenix + Ecto) Application
|
||||
|
||||
### Step 1: Add dependencies
|
||||
Install dependencies related to OpenTelemetry by adding them to `mix.exs` file
|
||||
|
||||
```bash
|
||||
{:opentelemetry_exporter, "~> 1.6"},
|
||||
{:opentelemetry_api, "~> 1.2"},
|
||||
{:opentelemetry, "~> 1.3"},
|
||||
{:opentelemetry_semantic_conventions, "~> 0.2"},
|
||||
{:opentelemetry_cowboy, "~> 0.2.1"},
|
||||
{:opentelemetry_phoenix, "~> 1.1"},
|
||||
{:opentelemetry_ecto, "~> 1.1"}
|
||||
```
|
||||
|
||||
|
||||
In your application start, usually the `application.ex` file, setup the telemetry handlers
|
||||
|
||||
```bash
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:{{MYAPP}}, :repo])
|
||||
```
|
||||
|
||||
|
||||
As an example, this is how you can setup the handlers in your application.ex file for an application called demo :
|
||||
|
||||
```bash
|
||||
# application.ex
|
||||
@impl true
|
||||
def start(_type, _args) do
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:demo, :repo])
|
||||
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Configure Application
|
||||
You need to configure your application to send telemetry data by adding the following config to your `runtime.exs` file:
|
||||
|
||||
```bash
|
||||
config :opentelemetry, :resource, service: %{name: "{{MYAPP}}"}
|
||||
|
||||
config :opentelemetry, :processors,
|
||||
otel_batch_processor: %{
|
||||
exporter: {
|
||||
:opentelemetry_exporter,
|
||||
%{
|
||||
endpoints: ["https://ingest.{{REGION}}.signoz.cloud:443"],
|
||||
headers: [
|
||||
{"signoz-ingestion-key", {{SIGNOZ_ACCESS_TOKEN}} }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
### Running your Elixir application
|
||||
Once you are done instrumenting your Elixir (Phoenix + Ecto) application with OpenTelemetry, you should install the dependencies needed to run your application and run it as you normally would.
|
||||
|
||||
|
||||
|
||||
To see some examples for instrumented applications, you can checkout [this link](https://signoz.io/docs/instrumentation/elixir/#sample-examples)
|
||||
@@ -1,96 +0,0 @@
|
||||
### Setup OpenTelemetry Binary as an agent
|
||||
|
||||
|
||||
### Step 1: Download otel-collector tar.gz
|
||||
```bash
|
||||
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v{{OTEL_VERSION}}/otelcol-contrib_{{OTEL_VERSION}}_darwin_amd64.tar.gz
|
||||
```
|
||||
|
||||
|
||||
### Step 2: Extract otel-collector tar.gz to the `otelcol-contrib` folder
|
||||
```bash
|
||||
mkdir otelcol-contrib && tar xvzf otelcol-contrib_{{OTEL_VERSION}}_darwin_amd64.tar.gz -C otelcol-contrib
|
||||
```
|
||||
|
||||
|
||||
### Step 3: Create config.yaml in folder otelcol-contrib with the below content in it
|
||||
```bash
|
||||
receivers:
|
||||
otlp:
|
||||
protocols:
|
||||
grpc:
|
||||
endpoint: 0.0.0.0:4317
|
||||
http:
|
||||
endpoint: 0.0.0.0:4318
|
||||
hostmetrics:
|
||||
collection_interval: 60s
|
||||
scrapers:
|
||||
cpu: {}
|
||||
disk: {}
|
||||
load: {}
|
||||
filesystem: {}
|
||||
memory: {}
|
||||
network: {}
|
||||
paging: {}
|
||||
process:
|
||||
mute_process_name_error: true
|
||||
mute_process_exe_error: true
|
||||
mute_process_io_error: true
|
||||
processes: {}
|
||||
prometheus:
|
||||
config:
|
||||
global:
|
||||
scrape_interval: 60s
|
||||
scrape_configs:
|
||||
- job_name: otel-collector-binary
|
||||
static_configs:
|
||||
- targets:
|
||||
# - localhost:8888
|
||||
processors:
|
||||
batch:
|
||||
send_batch_size: 1000
|
||||
timeout: 10s
|
||||
# Ref: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/resourcedetectionprocessor/README.md
|
||||
resourcedetection:
|
||||
detectors: [env, system] # Before system detector, include ec2 for AWS, gcp for GCP and azure for Azure.
|
||||
# Using OTEL_RESOURCE_ATTRIBUTES envvar, env detector adds custom labels.
|
||||
timeout: 2s
|
||||
system:
|
||||
hostname_sources: [os] # alternatively, use [dns,os] for setting FQDN as host.name and os as fallback
|
||||
extensions:
|
||||
health_check: {}
|
||||
zpages: {}
|
||||
exporters:
|
||||
otlp:
|
||||
endpoint: "ingest.{{REGION}}.signoz.cloud:443"
|
||||
tls:
|
||||
insecure: false
|
||||
headers:
|
||||
"signoz-ingestion-key": "{{SIGNOZ_INGESTION_KEY}}"
|
||||
logging:
|
||||
verbosity: normal
|
||||
service:
|
||||
telemetry:
|
||||
metrics:
|
||||
address: 0.0.0.0:8888
|
||||
extensions: [health_check, zpages]
|
||||
pipelines:
|
||||
metrics:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
metrics/internal:
|
||||
receivers: [prometheus, hostmetrics]
|
||||
processors: [resourcedetection, batch]
|
||||
exporters: [otlp]
|
||||
traces:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
logs:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
```
|
||||
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
|
||||
|
||||
After setting up the Otel collector agent, follow the steps below to instrument your Elixir (Phoenix + Ecto) Application
|
||||
|
||||
### Step 1: Add dependencies
|
||||
Install dependencies related to OpenTelemetry by adding them to `mix.exs` file
|
||||
|
||||
```bash
|
||||
{:opentelemetry_exporter, "~> 1.6"},
|
||||
{:opentelemetry_api, "~> 1.2"},
|
||||
{:opentelemetry, "~> 1.3"},
|
||||
{:opentelemetry_semantic_conventions, "~> 0.2"},
|
||||
{:opentelemetry_cowboy, "~> 0.2.1"},
|
||||
{:opentelemetry_phoenix, "~> 1.1"},
|
||||
{:opentelemetry_ecto, "~> 1.1"}
|
||||
```
|
||||
|
||||
|
||||
In your application start, usually the `application.ex` file, setup the telemetry handlers
|
||||
|
||||
```bash
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:{{MYAPP}}, :repo])
|
||||
```
|
||||
|
||||
|
||||
As an example, this is how you can setup the handlers in your application.ex file for an application called demo :
|
||||
|
||||
```bash
|
||||
# application.ex
|
||||
@impl true
|
||||
def start(_type, _args) do
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:demo, :repo])
|
||||
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Configure Application
|
||||
You need to configure your application to send telemetry data by adding the following config to your `runtime.exs` file:
|
||||
|
||||
```bash
|
||||
config :opentelemetry, :resource, service: %{name: "{{MYAPP}}"}
|
||||
|
||||
config :opentelemetry, :processors,
|
||||
otel_batch_processor: %{
|
||||
exporter:
|
||||
{:opentelemetry_exporter,
|
||||
%{endpoints: ["http://localhost:4318"]}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
|
||||
|
||||
### Step 1: Run OTel Collector
|
||||
Run this command inside the `otelcol-contrib` directory that you created in the install Otel Collector step
|
||||
|
||||
```bash
|
||||
./otelcol-contrib --config ./config.yaml &> otelcol-output.log & echo "$!" > otel-pid
|
||||
```
|
||||
|
||||
|
||||
#### (Optional Step): View last 50 lines of `otelcol` logs
|
||||
```bash
|
||||
tail -f -n 50 otelcol-output.log
|
||||
```
|
||||
|
||||
#### (Optional Step): Stop `otelcol`
|
||||
```bash
|
||||
kill "$(< otel-pid)"
|
||||
```
|
||||
|
||||
|
||||
### Step 2: Running your Elixir application
|
||||
Once you are done instrumenting your Elixir (Phoenix + Ecto) application with OpenTelemetry, you should install the dependencies needed to run your application and run it as you normally would.
|
||||
|
||||
|
||||
|
||||
To see some examples for instrumented applications, you can checkout [this link](https://signoz.io/docs/instrumentation/elixir/#sample-examples)
|
||||
```
|
||||
@@ -1,62 +0,0 @@
|
||||
|
||||
|
||||
Follow the steps below to instrument your Elixir (Phoenix + Ecto) Application
|
||||
|
||||
### Step 1: Add dependencies
|
||||
Install dependencies related to OpenTelemetry by adding them to `mix.exs` file
|
||||
|
||||
```bash
|
||||
{:opentelemetry_exporter, "~> 1.6"},
|
||||
{:opentelemetry_api, "~> 1.2"},
|
||||
{:opentelemetry, "~> 1.3"},
|
||||
{:opentelemetry_semantic_conventions, "~> 0.2"},
|
||||
{:opentelemetry_cowboy, "~> 0.2.1"},
|
||||
{:opentelemetry_phoenix, "~> 1.1"},
|
||||
{:opentelemetry_ecto, "~> 1.1"}
|
||||
```
|
||||
|
||||
|
||||
In your application start, usually the `application.ex` file, setup the telemetry handlers
|
||||
|
||||
```bash
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:{{MYAPP}}, :repo])
|
||||
```
|
||||
|
||||
|
||||
As an example, this is how you can setup the handlers in your application.ex file for an application called demo :
|
||||
|
||||
```bash
|
||||
# application.ex
|
||||
@impl true
|
||||
def start(_type, _args) do
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:demo, :repo])
|
||||
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Configure Application
|
||||
You need to configure your application to send telemetry data by adding the following config to your `runtime.exs` file:
|
||||
|
||||
```bash
|
||||
config :opentelemetry, :resource, service: %{name: "{{MYAPP}}"}
|
||||
|
||||
config :opentelemetry, :processors,
|
||||
otel_batch_processor: %{
|
||||
exporter: {
|
||||
:opentelemetry_exporter,
|
||||
%{
|
||||
endpoints: ["https://ingest.{{REGION}}.signoz.cloud:443"],
|
||||
headers: [
|
||||
{"signoz-ingestion-key", {{SIGNOZ_ACCESS_TOKEN}} }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
### Running your Elixir application
|
||||
Once you are done instrumenting your Elixir (Phoenix + Ecto) application with OpenTelemetry, you should install the dependencies needed to run your application and run it as you normally would.
|
||||
|
||||
|
||||
|
||||
To see some examples for instrumented applications, you can checkout [this link](https://signoz.io/docs/instrumentation/elixir/#sample-examples)
|
||||
@@ -1,96 +0,0 @@
|
||||
## Setup OpenTelemetry Binary as an agent
|
||||
|
||||
|
||||
### Step 1: Download otel-collector tar.gz
|
||||
```bash
|
||||
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v{{OTEL_VERSION}}/otelcol-contrib_{{OTEL_VERSION}}_darwin_arm64.tar.gz
|
||||
```
|
||||
|
||||
|
||||
### Step 2: Extract otel-collector tar.gz to the `otelcol-contrib` folder
|
||||
```bash
|
||||
mkdir otelcol-contrib && tar xvzf otelcol-contrib_{{OTEL_VERSION}}_darwin_arm64.tar.gz -C otelcol-contrib
|
||||
```
|
||||
|
||||
|
||||
### Step 3: Create config.yaml in folder otelcol-contrib with the below content in it
|
||||
```bash
|
||||
receivers:
|
||||
otlp:
|
||||
protocols:
|
||||
grpc:
|
||||
endpoint: 0.0.0.0:4317
|
||||
http:
|
||||
endpoint: 0.0.0.0:4318
|
||||
hostmetrics:
|
||||
collection_interval: 60s
|
||||
scrapers:
|
||||
cpu: {}
|
||||
disk: {}
|
||||
load: {}
|
||||
filesystem: {}
|
||||
memory: {}
|
||||
network: {}
|
||||
paging: {}
|
||||
process:
|
||||
mute_process_name_error: true
|
||||
mute_process_exe_error: true
|
||||
mute_process_io_error: true
|
||||
processes: {}
|
||||
prometheus:
|
||||
config:
|
||||
global:
|
||||
scrape_interval: 60s
|
||||
scrape_configs:
|
||||
- job_name: otel-collector-binary
|
||||
static_configs:
|
||||
- targets:
|
||||
# - localhost:8888
|
||||
processors:
|
||||
batch:
|
||||
send_batch_size: 1000
|
||||
timeout: 10s
|
||||
# Ref: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/resourcedetectionprocessor/README.md
|
||||
resourcedetection:
|
||||
detectors: [env, system] # Before system detector, include ec2 for AWS, gcp for GCP and azure for Azure.
|
||||
# Using OTEL_RESOURCE_ATTRIBUTES envvar, env detector adds custom labels.
|
||||
timeout: 2s
|
||||
system:
|
||||
hostname_sources: [os] # alternatively, use [dns,os] for setting FQDN as host.name and os as fallback
|
||||
extensions:
|
||||
health_check: {}
|
||||
zpages: {}
|
||||
exporters:
|
||||
otlp:
|
||||
endpoint: "ingest.{{REGION}}.signoz.cloud:443"
|
||||
tls:
|
||||
insecure: false
|
||||
headers:
|
||||
"signoz-ingestion-key": "{{SIGNOZ_INGESTION_KEY}}"
|
||||
logging:
|
||||
verbosity: normal
|
||||
service:
|
||||
telemetry:
|
||||
metrics:
|
||||
address: 0.0.0.0:8888
|
||||
extensions: [health_check, zpages]
|
||||
pipelines:
|
||||
metrics:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
metrics/internal:
|
||||
receivers: [prometheus, hostmetrics]
|
||||
processors: [resourcedetection, batch]
|
||||
exporters: [otlp]
|
||||
traces:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
logs:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
```
|
||||
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
|
||||
|
||||
After setting up the Otel collector agent, follow the steps below to instrument your Elixir (Phoenix + Ecto) Application
|
||||
|
||||
### Step 1: Add dependencies
|
||||
Install dependencies related to OpenTelemetry by adding them to `mix.exs` file
|
||||
|
||||
```bash
|
||||
{:opentelemetry_exporter, "~> 1.6"},
|
||||
{:opentelemetry_api, "~> 1.2"},
|
||||
{:opentelemetry, "~> 1.3"},
|
||||
{:opentelemetry_semantic_conventions, "~> 0.2"},
|
||||
{:opentelemetry_cowboy, "~> 0.2.1"},
|
||||
{:opentelemetry_phoenix, "~> 1.1"},
|
||||
{:opentelemetry_ecto, "~> 1.1"}
|
||||
```
|
||||
|
||||
|
||||
In your application start, usually the `application.ex` file, setup the telemetry handlers
|
||||
|
||||
```bash
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:{{MYAPP}}, :repo])
|
||||
```
|
||||
|
||||
|
||||
As an example, this is how you can setup the handlers in your application.ex file for an application called demo :
|
||||
|
||||
```bash
|
||||
# application.ex
|
||||
@impl true
|
||||
def start(_type, _args) do
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:demo, :repo])
|
||||
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Configure Application
|
||||
You need to configure your application to send telemetry data by adding the following config to your `runtime.exs` file:
|
||||
|
||||
```bash
|
||||
config :opentelemetry, :resource, service: %{name: "{{MYAPP}}"}
|
||||
|
||||
config :opentelemetry, :processors,
|
||||
otel_batch_processor: %{
|
||||
exporter:
|
||||
{:opentelemetry_exporter,
|
||||
%{endpoints: ["http://localhost:4318"]}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
|
||||
|
||||
### Step 1: Run OTel Collector
|
||||
Run this command inside the `otelcol-contrib` directory that you created in the install Otel Collector step
|
||||
|
||||
```bash
|
||||
./otelcol-contrib --config ./config.yaml &> otelcol-output.log & echo "$!" > otel-pid
|
||||
```
|
||||
|
||||
|
||||
#### (Optional Step): View last 50 lines of `otelcol` logs
|
||||
```bash
|
||||
tail -f -n 50 otelcol-output.log
|
||||
```
|
||||
|
||||
#### (Optional Step): Stop `otelcol`
|
||||
```bash
|
||||
kill "$(< otel-pid)"
|
||||
```
|
||||
|
||||
|
||||
### Step 2: Running your Elixir application
|
||||
Once you are done instrumenting your Elixir (Phoenix + Ecto) application with OpenTelemetry, you should install the dependencies needed to run your application and run it as you normally would.
|
||||
|
||||
|
||||
|
||||
To see some examples for instrumented applications, you can checkout [this link](https://signoz.io/docs/instrumentation/elixir/#sample-examples)
|
||||
```
|
||||
@@ -1,62 +0,0 @@
|
||||
|
||||
|
||||
Follow the steps below to instrument your Elixir (Phoenix + Ecto) Application
|
||||
|
||||
### Step 1: Add dependencies
|
||||
Install dependencies related to OpenTelemetry by adding them to `mix.exs` file
|
||||
|
||||
```bash
|
||||
{:opentelemetry_exporter, "~> 1.6"},
|
||||
{:opentelemetry_api, "~> 1.2"},
|
||||
{:opentelemetry, "~> 1.3"},
|
||||
{:opentelemetry_semantic_conventions, "~> 0.2"},
|
||||
{:opentelemetry_cowboy, "~> 0.2.1"},
|
||||
{:opentelemetry_phoenix, "~> 1.1"},
|
||||
{:opentelemetry_ecto, "~> 1.1"}
|
||||
```
|
||||
|
||||
|
||||
In your application start, usually the `application.ex` file, setup the telemetry handlers
|
||||
|
||||
```bash
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:{{MYAPP}}, :repo])
|
||||
```
|
||||
|
||||
|
||||
As an example, this is how you can setup the handlers in your application.ex file for an application called demo :
|
||||
|
||||
```bash
|
||||
# application.ex
|
||||
@impl true
|
||||
def start(_type, _args) do
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:demo, :repo])
|
||||
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Configure Application
|
||||
You need to configure your application to send telemetry data by adding the following config to your `runtime.exs` file:
|
||||
|
||||
```bash
|
||||
config :opentelemetry, :resource, service: %{name: "{{MYAPP}}"}
|
||||
|
||||
config :opentelemetry, :processors,
|
||||
otel_batch_processor: %{
|
||||
exporter: {
|
||||
:opentelemetry_exporter,
|
||||
%{
|
||||
endpoints: ["https://ingest.{{REGION}}.signoz.cloud:443"],
|
||||
headers: [
|
||||
{"signoz-ingestion-key", {{SIGNOZ_ACCESS_TOKEN}} }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
### Running your Elixir application
|
||||
Once you are done instrumenting your Elixir (Phoenix + Ecto) application with OpenTelemetry, you should install the dependencies needed to run your application and run it as you normally would.
|
||||
|
||||
|
||||
|
||||
To see some examples for instrumented applications, you can checkout [this link](https://signoz.io/docs/instrumentation/elixir/#sample-examples)
|
||||
@@ -1,105 +0,0 @@
|
||||
## Setup OpenTelemetry Binary as an agent
|
||||
|
||||
|
||||
### Step 1: Download otel-collector tar.gz
|
||||
|
||||
|
||||
|
||||
```bash
|
||||
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v{{OTEL_VERSION}}/otelcol-contrib_{{OTEL_VERSION}}_linux_amd64.tar.gz
|
||||
```
|
||||
|
||||
|
||||
### Step 2: Extract otel-collector tar.gz to the `otelcol-contrib` folder
|
||||
|
||||
|
||||
|
||||
```bash
|
||||
mkdir otelcol-contrib && tar xvzf otelcol-contrib_{{OTEL_VERSION}}_linux_amd64.tar.gz -C otelcol-contrib
|
||||
```
|
||||
|
||||
|
||||
### Step 3: Create config.yaml in folder otelcol-contrib with the below content in it
|
||||
|
||||
|
||||
|
||||
```bash
|
||||
receivers:
|
||||
otlp:
|
||||
protocols:
|
||||
grpc:
|
||||
endpoint: 0.0.0.0:4317
|
||||
http:
|
||||
endpoint: 0.0.0.0:4318
|
||||
hostmetrics:
|
||||
collection_interval: 60s
|
||||
scrapers:
|
||||
cpu: {}
|
||||
disk: {}
|
||||
load: {}
|
||||
filesystem: {}
|
||||
memory: {}
|
||||
network: {}
|
||||
paging: {}
|
||||
process:
|
||||
mute_process_name_error: true
|
||||
mute_process_exe_error: true
|
||||
mute_process_io_error: true
|
||||
processes: {}
|
||||
prometheus:
|
||||
config:
|
||||
global:
|
||||
scrape_interval: 60s
|
||||
scrape_configs:
|
||||
- job_name: otel-collector-binary
|
||||
static_configs:
|
||||
- targets:
|
||||
# - localhost:8888
|
||||
processors:
|
||||
batch:
|
||||
send_batch_size: 1000
|
||||
timeout: 10s
|
||||
# Ref: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/resourcedetectionprocessor/README.md
|
||||
resourcedetection:
|
||||
detectors: [env, system] # Before system detector, include ec2 for AWS, gcp for GCP and azure for Azure.
|
||||
# Using OTEL_RESOURCE_ATTRIBUTES envvar, env detector adds custom labels.
|
||||
timeout: 2s
|
||||
system:
|
||||
hostname_sources: [os] # alternatively, use [dns,os] for setting FQDN as host.name and os as fallback
|
||||
extensions:
|
||||
health_check: {}
|
||||
zpages: {}
|
||||
exporters:
|
||||
otlp:
|
||||
endpoint: "ingest.{{REGION}}.signoz.cloud:443"
|
||||
tls:
|
||||
insecure: false
|
||||
headers:
|
||||
"signoz-ingestion-key": "{{SIGNOZ_INGESTION_KEY}}"
|
||||
logging:
|
||||
verbosity: normal
|
||||
service:
|
||||
telemetry:
|
||||
metrics:
|
||||
address: 0.0.0.0:8888
|
||||
extensions: [health_check, zpages]
|
||||
pipelines:
|
||||
metrics:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
metrics/internal:
|
||||
receivers: [prometheus, hostmetrics]
|
||||
processors: [resourcedetection, batch]
|
||||
exporters: [otlp]
|
||||
traces:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
logs:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp]
|
||||
```
|
||||
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
|
||||
|
||||
After setting up the Otel collector agent, follow the steps below to instrument your Elixir (Phoenix + Ecto) Application
|
||||
|
||||
### Step 1: Add dependencies
|
||||
Install dependencies related to OpenTelemetry by adding them to `mix.exs` file
|
||||
|
||||
```bash
|
||||
{:opentelemetry_exporter, "~> 1.6"},
|
||||
{:opentelemetry_api, "~> 1.2"},
|
||||
{:opentelemetry, "~> 1.3"},
|
||||
{:opentelemetry_semantic_conventions, "~> 0.2"},
|
||||
{:opentelemetry_cowboy, "~> 0.2.1"},
|
||||
{:opentelemetry_phoenix, "~> 1.1"},
|
||||
{:opentelemetry_ecto, "~> 1.1"}
|
||||
```
|
||||
|
||||
|
||||
In your application start, usually the `application.ex` file, setup the telemetry handlers
|
||||
|
||||
```bash
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:{{MYAPP}}, :repo])
|
||||
```
|
||||
|
||||
|
||||
As an example, this is how you can setup the handlers in your application.ex file for an application called demo :
|
||||
|
||||
```bash
|
||||
# application.ex
|
||||
@impl true
|
||||
def start(_type, _args) do
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:demo, :repo])
|
||||
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 2: Configure Application
|
||||
You need to configure your application to send telemetry data by adding the following config to your `runtime.exs` file:
|
||||
|
||||
```bash
|
||||
config :opentelemetry, :resource, service: %{name: "{{MYAPP}}"}
|
||||
|
||||
config :opentelemetry, :processors,
|
||||
otel_batch_processor: %{
|
||||
exporter:
|
||||
{:opentelemetry_exporter,
|
||||
%{endpoints: ["http://localhost:4318"]}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
|
||||
OTel Collector binary helps to collect logs, hostmetrics, resource and infra attributes. It is recommended to install Otel Collector binary to collect and send traces to SigNoz cloud. You can correlate signals and have rich contextual data through this way.
|
||||
|
||||
You can find instructions to install OTel Collector binary [here](https://signoz.io/docs/tutorial/opentelemetry-binary-usage-in-virtual-machine/) in your VM. Once you are done setting up your OTel Collector binary, you can follow the below steps for instrumenting your Elixir (Phoenix + Ecto) application.
|
||||
|
||||
**Step 1. Add dependencies**
|
||||
|
||||
Install dependencies related to OpenTelemetry by adding them to `mix.exs` file
|
||||
|
||||
```bash
|
||||
{:opentelemetry_exporter, "~> 1.6"},
|
||||
{:opentelemetry_api, "~> 1.2"},
|
||||
{:opentelemetry, "~> 1.3"},
|
||||
{:opentelemetry_semantic_conventions, "~> 0.2"},
|
||||
{:opentelemetry_cowboy, "~> 0.2.1"},
|
||||
{:opentelemetry_phoenix, "~> 1.1"},
|
||||
{:opentelemetry_ecto, "~> 1.1"}
|
||||
```
|
||||
|
||||
In your application start, usually the `application.ex` file, setup the telemetry handlers
|
||||
|
||||
```elixir
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:YOUR_APP_NAME, :repo])
|
||||
```
|
||||
|
||||
As an example, this is how you can setup the handlers in your `application.ex` file for an application called `demo` :
|
||||
|
||||
```elixir
|
||||
# application.ex
|
||||
@impl true
|
||||
def start(_type, _args) do
|
||||
:opentelemetry_cowboy.setup()
|
||||
OpentelemetryPhoenix.setup(adapter: :cowboy2)
|
||||
OpentelemetryEcto.setup([:demo, :repo])
|
||||
|
||||
end
|
||||
```
|
||||
|
||||
**Step 2. Configure Application**
|
||||
|
||||
You need to configure your application to send telemtry data by adding the follwing config to your `runtime.exs` file:
|
||||
|
||||
```elixir
|
||||
config :opentelemetry, :resource, service: %{name: "{{MYAPP}}"}
|
||||
|
||||
config :opentelemetry, :processors,
|
||||
otel_batch_processor: %{
|
||||
exporter:
|
||||
{:opentelemetry_exporter,
|
||||
%{endpoints: ["http://localhost:4318"]}
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -1,414 +0,0 @@
|
||||
## Send Traces to SigNoz Cloud
|
||||
|
||||
### Application on VMs
|
||||
|
||||
From VMs, there are two ways to send data to SigNoz Cloud.
|
||||
|
||||
- Send traces directly to SigNoz Cloud (quick start)
|
||||
- Send traces via OTel Collector binary (recommended)
|
||||
|
||||
#### **Send traces directly to SigNoz Cloud**
|
||||
|
||||
1. **Install Dependencies**
|
||||
|
||||
Dependencies related to OpenTelemetry exporter and SDK have to be installed first. Note that we are assuming you are using `gin` request router. If you are using other request routers, check out the [corresponding package](https://signoz.io/docs/instrumentation/golang/#request-routers).
|
||||
|
||||
Run the below commands after navigating to the application source folder:
|
||||
|
||||
```bash
|
||||
go get go.opentelemetry.io/otel \
|
||||
go.opentelemetry.io/otel/trace \
|
||||
go.opentelemetry.io/otel/sdk \
|
||||
go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin \
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace \
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc
|
||||
```
|
||||
|
||||
2. **Declare environment variables for configuring OpenTelemetry**
|
||||
|
||||
Declare the following global variables in `main.go` which we will use to configure OpenTelemetry:
|
||||
|
||||
```bash
|
||||
var (
|
||||
serviceName = os.Getenv("SERVICE_NAME")
|
||||
collectorURL = os.Getenv("OTEL_EXPORTER_OTLP_ENDPOINT")
|
||||
insecure = os.Getenv("INSECURE_MODE")
|
||||
)
|
||||
```
|
||||
|
||||
3. **Instrument your Go application with OpenTelemetry**
|
||||
|
||||
To configure your application to send data we will need a function to initialize OpenTelemetry. Add the following snippet of code in your `main.go` file.
|
||||
|
||||
```go
|
||||
|
||||
import (
|
||||
.....
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/exporters/otlp/otlptrace"
|
||||
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
|
||||
|
||||
"go.opentelemetry.io/otel/sdk/resource"
|
||||
sdktrace "go.opentelemetry.io/otel/sdk/trace"
|
||||
)
|
||||
|
||||
func initTracer() func(context.Context) error {
|
||||
|
||||
var secureOption otlptracegrpc.Option
|
||||
|
||||
if strings.ToLower(insecure) == "false" || insecure == "0" || strings.ToLower(insecure) == "f" {
|
||||
secureOption = otlptracegrpc.WithTLSCredentials(credentials.NewClientTLSFromCert(nil, ""))
|
||||
} else {
|
||||
secureOption = otlptracegrpc.WithInsecure()
|
||||
}
|
||||
|
||||
exporter, err := otlptrace.New(
|
||||
context.Background(),
|
||||
otlptracegrpc.NewClient(
|
||||
secureOption,
|
||||
otlptracegrpc.WithEndpoint(collectorURL),
|
||||
),
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to create exporter: %v", err)
|
||||
}
|
||||
resources, err := resource.New(
|
||||
context.Background(),
|
||||
resource.WithAttributes(
|
||||
attribute.String("service.name", serviceName),
|
||||
attribute.String("library.language", "go"),
|
||||
),
|
||||
)
|
||||
if err != nil {
|
||||
log.Fatalf("Could not set resources: %v", err)
|
||||
}
|
||||
|
||||
otel.SetTracerProvider(
|
||||
sdktrace.NewTracerProvider(
|
||||
sdktrace.WithSampler(sdktrace.AlwaysSample()),
|
||||
sdktrace.WithBatcher(exporter),
|
||||
sdktrace.WithResource(resources),
|
||||
),
|
||||
)
|
||||
return exporter.Shutdown
|
||||
}
|
||||
```
|
||||
|
||||
4. **Initialize the tracer in main.go**
|
||||
|
||||
Modify the main function to initialise the tracer in `main.go`. Initiate the tracer at the very beginning of our main function.
|
||||
|
||||
```go
|
||||
func main() {
|
||||
cleanup := initTracer()
|
||||
defer cleanup(context.Background())
|
||||
|
||||
......
|
||||
}
|
||||
```
|
||||
|
||||
5. **Add the OpenTelemetry Gin middleware**
|
||||
|
||||
Configure Gin to use the middleware by adding the following lines in `main.go`.
|
||||
|
||||
```go
|
||||
import (
|
||||
....
|
||||
"go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin"
|
||||
)
|
||||
|
||||
func main() {
|
||||
......
|
||||
r := gin.Default()
|
||||
r.Use(otelgin.Middleware(serviceName))
|
||||
......
|
||||
}
|
||||
```
|
||||
|
||||
6. **Set environment variables and run your Go Gin application**
|
||||
|
||||
The run command must have some environment variables to send data to SigNoz cloud. The run command:
|
||||
|
||||
```bash
|
||||
SERVICE_NAME={{MYAPP}} INSECURE_MODE=false OTEL_EXPORTER_OTLP_HEADERS=signoz-ingestion-key={{SIGNOZ_INGESTION_KEY}} OTEL_EXPORTER_OTLP_ENDPOINT=ingest.{{REGION}}.signoz.cloud:443 go run main.go
|
||||
```
|
||||
|
||||
If you want to update your `service_name`, you can modify the `SERVICE_NAME` variable.
|
||||
|
||||
---
|
||||
|
||||
#### **Send traces via OTel Collector binary**
|
||||
|
||||
OTel Collector binary helps to collect logs, hostmetrics, resource and infra attributes. It is recommended to install Otel Collector binary to collect and send traces to SigNoz cloud. You can correlate signals and have rich contextual data through this way.
|
||||
|
||||
You can find instructions to install OTel Collector binary [here](https://signoz.io/docs/tutorial/opentelemetry-binary-usage-in-virtual-machine/) in your VM. Once you are done setting up your OTel Collector binary, you can follow the below steps for instrumenting your Golang application.
|
||||
|
||||
1. **Install Dependencies**
|
||||
|
||||
Dependencies related to OpenTelemetry exporter and SDK have to be installed first. Note that we are assuming you are using `gin` request router. If you are using other request routers, check out the [corresponding package](https://signoz.io/docs/instrumentation/golang/#request-routers).
|
||||
|
||||
Run the below commands after navigating to the application source folder:
|
||||
|
||||
```bash
|
||||
go get go.opentelemetry.io/otel \
|
||||
go.opentelemetry.io/otel/trace \
|
||||
go.opentelemetry.io/otel/sdk \
|
||||
go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin \
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace \
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc
|
||||
```
|
||||
|
||||
2. **Declare environment variables for configuring OpenTelemetry**
|
||||
|
||||
Declare the following global variables in `main.go` which we will use to configure OpenTelemetry:
|
||||
|
||||
```go
|
||||
var (
|
||||
serviceName = os.Getenv("SERVICE_NAME")
|
||||
collectorURL = os.Getenv("OTEL_EXPORTER_OTLP_ENDPOINT")
|
||||
insecure = os.Getenv("INSECURE_MODE")
|
||||
)
|
||||
```
|
||||
|
||||
3. **Instrument your Go application with OpenTelemetry**
|
||||
|
||||
To configure your application to send data we will need a function to initialize OpenTelemetry. Add the following snippet of code in your `main.go` file.
|
||||
|
||||
```go
|
||||
|
||||
import (
|
||||
.....
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/exporters/otlp/otlptrace"
|
||||
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
|
||||
|
||||
"go.opentelemetry.io/otel/sdk/resource"
|
||||
sdktrace "go.opentelemetry.io/otel/sdk/trace"
|
||||
)
|
||||
|
||||
func initTracer() func(context.Context) error {
|
||||
|
||||
var secureOption otlptracegrpc.Option
|
||||
|
||||
if strings.ToLower(insecure) == "false" || insecure == "0" || strings.ToLower(insecure) == "f" {
|
||||
secureOption = otlptracegrpc.WithTLSCredentials(credentials.NewClientTLSFromCert(nil, ""))
|
||||
} else {
|
||||
secureOption = otlptracegrpc.WithInsecure()
|
||||
}
|
||||
|
||||
exporter, err := otlptrace.New(
|
||||
context.Background(),
|
||||
otlptracegrpc.NewClient(
|
||||
secureOption,
|
||||
otlptracegrpc.WithEndpoint(collectorURL),
|
||||
),
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to create exporter: %v", err)
|
||||
}
|
||||
resources, err := resource.New(
|
||||
context.Background(),
|
||||
resource.WithAttributes(
|
||||
attribute.String("service.name", serviceName),
|
||||
attribute.String("library.language", "go"),
|
||||
),
|
||||
)
|
||||
if err != nil {
|
||||
log.Fatalf("Could not set resources: %v", err)
|
||||
}
|
||||
|
||||
otel.SetTracerProvider(
|
||||
sdktrace.NewTracerProvider(
|
||||
sdktrace.WithSampler(sdktrace.AlwaysSample()),
|
||||
sdktrace.WithBatcher(exporter),
|
||||
sdktrace.WithResource(resources),
|
||||
),
|
||||
)
|
||||
return exporter.Shutdown
|
||||
}
|
||||
|
||||
4. **Initialize the tracer in main.go**
|
||||
|
||||
Modify the main function to initialise the tracer in `main.go`. Initiate the tracer at the very beginning of our main function.
|
||||
|
||||
```go
|
||||
func main() {
|
||||
cleanup := initTracer()
|
||||
defer cleanup(context.Background())
|
||||
|
||||
......
|
||||
}
|
||||
```
|
||||
|
||||
5. **Add the OpenTelemetry Gin middleware**
|
||||
|
||||
Configure Gin to use the middleware by adding the following lines in `main.go`.
|
||||
|
||||
```go
|
||||
import (
|
||||
....
|
||||
"go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin"
|
||||
)
|
||||
|
||||
func main() {
|
||||
......
|
||||
r := gin.Default()
|
||||
r.Use(otelgin.Middleware(serviceName))
|
||||
......
|
||||
}
|
||||
```
|
||||
|
||||
6. **Set environment variables and run your Go Gin application**
|
||||
|
||||
The run command must have some environment variables to send data to SigNoz. The run command:
|
||||
|
||||
```bash
|
||||
SERVICE_NAME={{MYAPP}} INSECURE_MODE=true OTEL_EXPORTER_OTLP_ENDPOINT=localhost:4317 go run main.go
|
||||
```
|
||||
|
||||
If you want to update your `service_name`, you can modify the `SERVICE_NAME` variable.
|
||||
|
||||
---
|
||||
|
||||
### Applications Deployed on Kubernetes
|
||||
|
||||
For Golang application deployed on Kubernetes, you need to install OTel Collector agent in your k8s infra to collect and send traces to SigNoz Cloud. You can find the instructions to install OTel Collector agent [here](https://signoz.io/docs/tutorial/kubernetes-infra-metrics/).
|
||||
|
||||
Once you have set up OTel Collector agent, you can proceed with OpenTelemetry Golang instrumentation by following the below steps:
|
||||
|
||||
1. **Install Dependencies**
|
||||
|
||||
Dependencies related to OpenTelemetry exporter and SDK have to be installed first. Note that we are assuming you are using `gin` request router. If you are using other request routers, check out the [corresponding package](https://signoz.io/docs/instrumentation/golang/#request-routers).
|
||||
|
||||
Run the below commands after navigating to the application source folder:
|
||||
|
||||
```bash
|
||||
go get go.opentelemetry.io/otel \
|
||||
go.opentelemetry.io/otel/trace \
|
||||
go.opentelemetry.io/otel/sdk \
|
||||
go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin \
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace \
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc
|
||||
```
|
||||
|
||||
2. **Declare environment variables for configuring OpenTelemetry**
|
||||
|
||||
Declare the following global variables in `main.go` which we will use to configure OpenTelemetry:
|
||||
|
||||
```go
|
||||
var (
|
||||
serviceName = os.Getenv("SERVICE_NAME")
|
||||
collectorURL = os.Getenv("OTEL_EXPORTER_OTLP_ENDPOINT")
|
||||
insecure = os.Getenv("INSECURE_MODE")
|
||||
)
|
||||
```
|
||||
|
||||
3. **Instrument your Go application with OpenTelemetry**
|
||||
|
||||
To configure your application to send data we will need a function to initialize OpenTelemetry. Add the following snippet of code in your `main.go` file.
|
||||
|
||||
```go
|
||||
|
||||
import (
|
||||
.....
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/exporters/otlp/otlptrace"
|
||||
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
|
||||
|
||||
"go.opentelemetry.io/otel/sdk/resource"
|
||||
sdktrace "go.opentelemetry.io/otel/sdk/trace"
|
||||
)
|
||||
|
||||
func initTracer() func(context.Context) error {
|
||||
|
||||
var secureOption otlptracegrpc.Option
|
||||
|
||||
if strings.ToLower(insecure) == "false" || insecure == "0" || strings.ToLower(insecure) == "f" {
|
||||
secureOption = otlptracegrpc.WithTLSCredentials(credentials.NewClientTLSFromCert(nil, ""))
|
||||
} else {
|
||||
secureOption = otlptracegrpc.WithInsecure()
|
||||
}
|
||||
|
||||
exporter, err := otlptrace.New(
|
||||
context.Background(),
|
||||
otlptracegrpc.NewClient(
|
||||
secureOption,
|
||||
otlptracegrpc.WithEndpoint(collectorURL),
|
||||
),
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to create exporter: %v", err)
|
||||
}
|
||||
resources, err := resource.New(
|
||||
context.Background(),
|
||||
resource.WithAttributes(
|
||||
attribute.String("service.name", serviceName),
|
||||
attribute.String("library.language", "go"),
|
||||
),
|
||||
)
|
||||
if err != nil {
|
||||
log.Fatalf("Could not set resources: %v", err)
|
||||
}
|
||||
|
||||
otel.SetTracerProvider(
|
||||
sdktrace.NewTracerProvider(
|
||||
sdktrace.WithSampler(sdktrace.AlwaysSample()),
|
||||
sdktrace.WithBatcher(exporter),
|
||||
sdktrace.WithResource(resources),
|
||||
),
|
||||
)
|
||||
return exporter.Shutdown
|
||||
}
|
||||
|
||||
4. **Initialize the tracer in main.go**
|
||||
|
||||
Modify the main function to initialise the tracer in `main.go`. Initiate the tracer at the very beginning of our main function.
|
||||
|
||||
```go
|
||||
func main() {
|
||||
cleanup := initTracer()
|
||||
defer cleanup(context.Background())
|
||||
|
||||
......
|
||||
}
|
||||
```
|
||||
|
||||
5. **Add the OpenTelemetry Gin middleware**
|
||||
|
||||
Configure Gin to use the middleware by adding the following lines in `main.go`.
|
||||
|
||||
```go
|
||||
import (
|
||||
....
|
||||
"go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin"
|
||||
)
|
||||
|
||||
func main() {
|
||||
......
|
||||
r := gin.Default()
|
||||
r.Use(otelgin.Middleware(serviceName))
|
||||
......
|
||||
}
|
||||
```
|
||||
|
||||
6. **Set environment variables and run your Go Gin application**
|
||||
|
||||
The run command must have some environment variables to send data to SigNoz. The run command:
|
||||
|
||||
```bash
|
||||
SERVICE_NAME={{MYAPP}} INSECURE_MODE=true OTEL_EXPORTER_OTLP_ENDPOINT=localhost:4317 go run main.go
|
||||
```
|
||||
|
||||
If you want to update your `service_name`, you can modify the `SERVICE_NAME` variable.
|
||||
@@ -1,135 +0,0 @@
|
||||
### Step 1: Install OpenTelemetry Dependencies
|
||||
Dependencies related to OpenTelemetry exporter and SDK have to be installed first.
|
||||
|
||||
Run the below commands after navigating to the application source folder:
|
||||
```bash
|
||||
go get go.opentelemetry.io/otel \
|
||||
go.opentelemetry.io/otel/trace \
|
||||
go.opentelemetry.io/otel/sdk \
|
||||
go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin \
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace \
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc
|
||||
```
|
||||
|
||||
**Note:** We are assuming you are using gin request router. If you are using other request routers, check out the [corresponding package](https://signoz.io/docs/instrumentation/golang/#request-routers).
|
||||
|
||||
|
||||
|
||||
### Step 2: Declare environment variables for configuring OpenTelemetry
|
||||
Declare the following global variables in **`main.go`** which we will use to configure OpenTelemetry:
|
||||
```bash
|
||||
var (
|
||||
serviceName = os.Getenv("SERVICE_NAME")
|
||||
collectorURL = os.Getenv("OTEL_EXPORTER_OTLP_ENDPOINT")
|
||||
insecure = os.Getenv("INSECURE_MODE")
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
### Step 3: Instrument your Go application
|
||||
To configure your application to send data we will need a function to initialize OpenTelemetry. Add the following snippet of code in your **`main.go`** file.
|
||||
|
||||
```bash
|
||||
|
||||
import (
|
||||
.....
|
||||
|
||||
"google.golang.org/grpc/credentials"
|
||||
"github.com/gin-gonic/gin"
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/exporters/otlp/otlptrace"
|
||||
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
|
||||
|
||||
"go.opentelemetry.io/otel/sdk/resource"
|
||||
sdktrace "go.opentelemetry.io/otel/sdk/trace"
|
||||
)
|
||||
|
||||
func initTracer() func(context.Context) error {
|
||||
|
||||
var secureOption otlptracegrpc.Option
|
||||
|
||||
if strings.ToLower(insecure) == "false" || insecure == "0" || strings.ToLower(insecure) == "f" {
|
||||
secureOption = otlptracegrpc.WithTLSCredentials(credentials.NewClientTLSFromCert(nil, ""))
|
||||
} else {
|
||||
secureOption = otlptracegrpc.WithInsecure()
|
||||
}
|
||||
|
||||
exporter, err := otlptrace.New(
|
||||
context.Background(),
|
||||
otlptracegrpc.NewClient(
|
||||
secureOption,
|
||||
otlptracegrpc.WithEndpoint(collectorURL),
|
||||
),
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to create exporter: %v", err)
|
||||
}
|
||||
resources, err := resource.New(
|
||||
context.Background(),
|
||||
resource.WithAttributes(
|
||||
attribute.String("service.name", serviceName),
|
||||
attribute.String("library.language", "go"),
|
||||
),
|
||||
)
|
||||
if err != nil {
|
||||
log.Fatalf("Could not set resources: %v", err)
|
||||
}
|
||||
|
||||
otel.SetTracerProvider(
|
||||
sdktrace.NewTracerProvider(
|
||||
sdktrace.WithSampler(sdktrace.AlwaysSample()),
|
||||
sdktrace.WithBatcher(exporter),
|
||||
sdktrace.WithResource(resources),
|
||||
),
|
||||
)
|
||||
return exporter.Shutdown
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Step 4: Initialise the tracer in **`main.go`**
|
||||
Modify the main function to initialise the tracer in **`main.go`**. Initiate the tracer at the very beginning of our main function.
|
||||
```bash
|
||||
func main() {
|
||||
cleanup := initTracer()
|
||||
defer cleanup(context.Background())
|
||||
|
||||
......
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Step 5: Add the OpenTelemetry Gin middleware
|
||||
Configure Gin to use the middleware by adding the following lines in **`main.go`**
|
||||
```bash
|
||||
import (
|
||||
....
|
||||
"go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin"
|
||||
)
|
||||
|
||||
func main() {
|
||||
......
|
||||
r := gin.Default()
|
||||
r.Use(otelgin.Middleware(serviceName))
|
||||
......
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 6: Dockerize your application
|
||||
|
||||
Set the environment variables in your Dockerfile.
|
||||
|
||||
```bash
|
||||
...
|
||||
# Set environment variables
|
||||
ENV SERVICE_NAME={{MYAPP}} \
|
||||
INSECURE_MODE=false \
|
||||
OTEL_EXPORTER_OTLP_HEADERS="signoz-ingestion-key=b{{SIGNOZ_INGESTION_KEY}}" \
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT=ingest.{{REGION}}.signoz.cloud:443
|
||||
...
|
||||
```
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
Once you update your Dockerfile, you can build and run it using the commands below.
|
||||
|
||||
|
||||
|
||||
### Step 1: Build your dockerfile
|
||||
|
||||
Build your docker image
|
||||
|
||||
```bash
|
||||
docker build -t <your-image-name> .
|
||||
```
|
||||
|
||||
- `<your-image-name>` is the name of your Docker Image
|
||||
|
||||
|
||||
|
||||
### Step 2: Run your docker image
|
||||
|
||||
```bash
|
||||
docker run <your-image-name>
|
||||
```
|
||||
@@ -1,12 +0,0 @@
|
||||
## Setup OpenTelemetry Binary as an agent
|
||||
|
||||
|
||||
|
||||
As a first step, you should install the OTel collector Binary according to the instructions provided on [this link](https://signoz.io/docs/tutorial/opentelemetry-binary-usage-in-virtual-machine/).
|
||||
|
||||
|
||||
|
||||
Once you are done setting up the OTel collector binary, you can follow the next steps.
|
||||
|
||||
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
After setting up the Otel collector agent, follow the steps below to instrument your Go Application
|
||||
|
||||
|
||||
|
||||
### Step 1: Install OpenTelemetry Dependencies
|
||||
Dependencies related to OpenTelemetry exporter and SDK have to be installed first.
|
||||
|
||||
Run the below commands after navigating to the application source folder:
|
||||
```bash
|
||||
go get go.opentelemetry.io/otel \
|
||||
go.opentelemetry.io/otel/trace \
|
||||
go.opentelemetry.io/otel/sdk \
|
||||
go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin \
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace \
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc
|
||||
```
|
||||
|
||||
**Note:** We are assuming you are using gin request router. If you are using other request routers, check out the [corresponding package](https://signoz.io/docs/instrumentation/golang/#request-routers).
|
||||
|
||||
|
||||
|
||||
### Step 2: Declare environment variables for configuring OpenTelemetry
|
||||
Declare the following global variables in **`main.go`** which we will use to configure OpenTelemetry:
|
||||
```bash
|
||||
var (
|
||||
serviceName = os.Getenv("SERVICE_NAME")
|
||||
collectorURL = os.Getenv("OTEL_EXPORTER_OTLP_ENDPOINT")
|
||||
insecure = os.Getenv("INSECURE_MODE")
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
### Step 3: Instrument your Go application
|
||||
To configure your application to send data we will need a function to initialize OpenTelemetry. Add the following snippet of code in your **`main.go`** file.
|
||||
|
||||
```bash
|
||||
|
||||
import (
|
||||
.....
|
||||
|
||||
"google.golang.org/grpc/credentials"
|
||||
"github.com/gin-gonic/gin"
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/exporters/otlp/otlptrace"
|
||||
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
|
||||
|
||||
"go.opentelemetry.io/otel/sdk/resource"
|
||||
sdktrace "go.opentelemetry.io/otel/sdk/trace"
|
||||
)
|
||||
|
||||
func initTracer() func(context.Context) error {
|
||||
|
||||
var secureOption otlptracegrpc.Option
|
||||
|
||||
if strings.ToLower(insecure) == "false" || insecure == "0" || strings.ToLower(insecure) == "f" {
|
||||
secureOption = otlptracegrpc.WithTLSCredentials(credentials.NewClientTLSFromCert(nil, ""))
|
||||
} else {
|
||||
secureOption = otlptracegrpc.WithInsecure()
|
||||
}
|
||||
|
||||
exporter, err := otlptrace.New(
|
||||
context.Background(),
|
||||
otlptracegrpc.NewClient(
|
||||
secureOption,
|
||||
otlptracegrpc.WithEndpoint(collectorURL),
|
||||
),
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to create exporter: %v", err)
|
||||
}
|
||||
resources, err := resource.New(
|
||||
context.Background(),
|
||||
resource.WithAttributes(
|
||||
attribute.String("service.name", serviceName),
|
||||
attribute.String("library.language", "go"),
|
||||
),
|
||||
)
|
||||
if err != nil {
|
||||
log.Fatalf("Could not set resources: %v", err)
|
||||
}
|
||||
|
||||
otel.SetTracerProvider(
|
||||
sdktrace.NewTracerProvider(
|
||||
sdktrace.WithSampler(sdktrace.AlwaysSample()),
|
||||
sdktrace.WithBatcher(exporter),
|
||||
sdktrace.WithResource(resources),
|
||||
),
|
||||
)
|
||||
return exporter.Shutdown
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Step 4: Initialise the tracer in **`main.go`**
|
||||
Modify the main function to initialise the tracer in **`main.go`**. Initiate the tracer at the very beginning of our main function.
|
||||
```bash
|
||||
func main() {
|
||||
cleanup := initTracer()
|
||||
defer cleanup(context.Background())
|
||||
|
||||
......
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Step 5: Add the OpenTelemetry Gin middleware
|
||||
Configure Gin to use the middleware by adding the following lines in **`main.go`**
|
||||
```bash
|
||||
import (
|
||||
....
|
||||
"go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin"
|
||||
)
|
||||
|
||||
func main() {
|
||||
......
|
||||
r := gin.Default()
|
||||
r.Use(otelgin.Middleware(serviceName))
|
||||
......
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Step 6: Dockerize your application
|
||||
|
||||
Set the environment variables in your Dockerfile.
|
||||
|
||||
```bash
|
||||
...
|
||||
# Set environment variables
|
||||
ENV SERVICE_NAME={{MYAPP}} \
|
||||
INSECURE_MODE=true \
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT=localhost:4317
|
||||
...
|
||||
```
|
||||
@@ -1,21 +0,0 @@
|
||||
Once you update your Dockerfile, you can build and run it using the commands below.
|
||||
|
||||
|
||||
|
||||
### Step 1: Build your dockerfile
|
||||
|
||||
Build your docker image
|
||||
|
||||
```bash
|
||||
docker build -t <your-image-name> .
|
||||
```
|
||||
|
||||
- `<your-image-name>` is the name of your Docker Image
|
||||
|
||||
|
||||
|
||||
### Step 2: Run your docker image
|
||||
|
||||
```bash
|
||||
docker run <your-image-name>
|
||||
```
|
||||
@@ -1,43 +0,0 @@
|
||||
### Install otel-collector in your Kubernetes infra
|
||||
|
||||
Add the SigNoz Helm Chart repository
|
||||
```bash
|
||||
helm repo add signoz https://charts.signoz.io
|
||||
```
|
||||
|
||||
|
||||
|
||||
If the chart is already present, update the chart to the latest using:
|
||||
```bash
|
||||
helm repo update
|
||||
```
|
||||
|
||||
|
||||
|
||||
For generic Kubernetes clusters, you can create *override-values.yaml* with the following configuration:
|
||||
|
||||
```yaml
|
||||
global:
|
||||
cloud: others
|
||||
clusterName: <CLUSTER_NAME>
|
||||
deploymentEnvironment: <DEPLOYMENT_ENVIRONMENT>
|
||||
otelCollectorEndpoint: ingest.{{REGION}}.signoz.cloud:443
|
||||
otelInsecure: false
|
||||
signozApiKey: {{SIGNOZ_INGESTION_KEY}}
|
||||
presets:
|
||||
otlpExporter:
|
||||
enabled: true
|
||||
loggingExporter:
|
||||
enabled: false
|
||||
```
|
||||
|
||||
- Replace `<CLUSTER_NAME>` with the name of the Kubernetes cluster or a unique identifier of the cluster.
|
||||
- Replace `<DEPLOYMENT_ENVIRONMENT>` with the deployment environment of your application. Example: **"staging"**, **"production"**, etc.
|
||||
|
||||
|
||||
|
||||
To install the k8s-infra chart with the above configuration, run the following command:
|
||||
|
||||
```bash
|
||||
helm install my-release signoz/k8s-infra -f override-values.yaml
|
||||
```
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user