Skip to content

Commit

Permalink
[8.x] [Logs Data Telemetry] Report telemetry events to telemetry serv…
Browse files Browse the repository at this point in the history
…ice (#192868) (#194244)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Logs Data Telemetry] Report telemetry events to telemetry service
(#192868)](#192868)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Abdul Wahab
Zahid","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-27T02:47:02Z","message":"[Logs
Data Telemetry] Report telemetry events to telemetry service
(#192868)\n\nDefine the schema and register the
[Usage\r\nCollector](https://docs.elastic.dev/telemetry/collection/snapshot-telemetry#creating-and-registering-usage-collector)\r\nto
report Logs Data telemetry events introduced
in\r\nhttps://github.com//pull/189380.\r\n\r\nThis
introduces a
telemetry\r\n[subsection](https://docs.elastic.dev/telemetry/kibana-snapshot-subsections)\r\nunder
`stats.stack_stats.kibana.plugins.logs_data`.","sha":"5f49cb897281bdd729e25873875c9f57aa492a47","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-logs"],"title":"[Logs
Data Telemetry] Report telemetry events to telemetry
service","number":192868,"url":"https://github.com/elastic/kibana/pull/192868","mergeCommit":{"message":"[Logs
Data Telemetry] Report telemetry events to telemetry service
(#192868)\n\nDefine the schema and register the
[Usage\r\nCollector](https://docs.elastic.dev/telemetry/collection/snapshot-telemetry#creating-and-registering-usage-collector)\r\nto
report Logs Data telemetry events introduced
in\r\nhttps://github.com//pull/189380.\r\n\r\nThis
introduces a
telemetry\r\n[subsection](https://docs.elastic.dev/telemetry/kibana-snapshot-subsections)\r\nunder
`stats.stack_stats.kibana.plugins.logs_data`.","sha":"5f49cb897281bdd729e25873875c9f57aa492a47"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/192868","number":192868,"mergeCommit":{"message":"[Logs
Data Telemetry] Report telemetry events to telemetry service
(#192868)\n\nDefine the schema and register the
[Usage\r\nCollector](https://docs.elastic.dev/telemetry/collection/snapshot-telemetry#creating-and-registering-usage-collector)\r\nto
report Logs Data telemetry events introduced
in\r\nhttps://github.com//pull/189380.\r\n\r\nThis
introduces a
telemetry\r\n[subsection](https://docs.elastic.dev/telemetry/kibana-snapshot-subsections)\r\nunder
`stats.stack_stats.kibana.plugins.logs_data`.","sha":"5f49cb897281bdd729e25873875c9f57aa492a47"}}]}]
BACKPORT-->

Co-authored-by: Abdul Wahab Zahid <[email protected]>
  • Loading branch information
kibanamachine and awahab07 authored Sep 27, 2024
1 parent 3f1ef96 commit 621b192
Show file tree
Hide file tree
Showing 11 changed files with 572 additions and 147 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"dataViews",
"lens",
"fieldsMetadata",
"taskManager"
"taskManager",
"usageCollection"
],
"optionalPlugins": ["telemetry"],
"requiredBundles": ["unifiedHistogram", "discover"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class DatasetQualityServerPlugin implements Plugin {
});

// Setup Data Telemetry Service
this.dataTelemetryService.setup(core.analytics, plugins.taskManager);
this.dataTelemetryService.setup(plugins.taskManager, plugins.usageCollection);

return {};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { DATA_DATASETS_INDEX_PATTERNS_UNIQUE } from '@kbn/telemetry-plugin/serve
import { DatasetIndexPattern } from './types';

export const LOGS_DATA_TELEMETRY_TASK_TYPE = 'logs-data-telemetry';
export const LOGS_DATA_TELEMETRY_TASK_ID = 'logs-data-telemetry:collect-and-report-task-2';
export const LOGS_DATA_TELEMETRY_TASK_ID = 'logs-data-telemetry:collect-and-report-task';

export const TELEMETRY_TASK_INTERVAL = 24 * 60; // 24 hours (in minutes)
export const TELEMETRY_TASK_TIMEOUT = 10; // 10 minutes
Expand All @@ -23,8 +23,6 @@ export const MAX_STREAMS_TO_REPORT = 1000;
export const NON_LOG_SIGNALS = ['metrics', 'traces', 'internal', 'synthetics'];
export const EXCLUDE_ELASTIC_LOGS = ['logs-synth', 'logs-elastic', 'logs-endpoint'];

export const TELEMETRY_CHANNEL = 'logs-data-telemetry';

type ObsPatternName = (typeof DATA_DATASETS_INDEX_PATTERNS_UNIQUE)[number]['patternName'];
const LOGS_INDEX_PATTERN_NAMES: ObsPatternName[] = [
'filebeat',
Expand Down
Loading

0 comments on commit 621b192

Please sign in to comment.