Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Otel compat mode #205113

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
19cfadb
[Streams] Refactor APIs to follow Elasticsearch conventions
simianhacker Dec 17, 2024
ee1004e
Merge branch 'main' of github.com:elastic/kibana into streams/refacto…
simianhacker Dec 18, 2024
af2813c
Fixing security solution missing line ending
simianhacker Dec 18, 2024
236fbda
[CI] Auto-commit changed files from 'node scripts/build_plugin_list_d…
kibanamachine Dec 18, 2024
528bc3f
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Dec 18, 2024
4c09c02
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Dec 18, 2024
a2dc69b
Adding FieldDefinitionConfigWithName; refactoring the sample preview …
simianhacker Dec 19, 2024
8a9ff5b
Merge branch 'main' of github.com:elastic/kibana into streams/refacto…
simianhacker Dec 19, 2024
bcec475
more cleanup
simianhacker Dec 19, 2024
c8b9d32
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Dec 19, 2024
e236177
Additional type cleanup
simianhacker Dec 19, 2024
51f97ed
Merge branch 'main' of github.com:elastic/kibana into streams/refacto…
simianhacker Dec 19, 2024
1579521
Fixing duplicate schema
simianhacker Dec 19, 2024
f00910c
moving routing and wired under ingest
simianhacker Dec 19, 2024
534f2ec
Merge branch 'main' of github.com:elastic/kibana into streams/refacto…
simianhacker Dec 19, 2024
bbb2811
removing common/index.ts
simianhacker Dec 19, 2024
ad36456
Merge remote-tracking branch 'upstream/main' into streams/refactor-ap…
flash1293 Dec 20, 2024
e4b7272
fix tests
flash1293 Dec 20, 2024
2651d16
Merge remote-tracking branch 'upstream/main' into streams/refactor-ap…
flash1293 Dec 23, 2024
71cd57a
fix tests
flash1293 Dec 23, 2024
43b377a
make work with otel
flash1293 Dec 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ x-pack/packages/kbn-ai-assistant @elastic/search-kibana
x-pack/packages/kbn-alerting-comparators @elastic/response-ops
x-pack/packages/kbn-alerting-state-types @elastic/response-ops
x-pack/packages/kbn-random-sampling @elastic/kibana-visualizations
x-pack/packages/kbn-streams-schema @elastic/streams-program-team
x-pack/packages/kbn-synthetics-private-location @elastic/obs-ux-management-team
x-pack/packages/maps/vector_tile_utils @elastic/kibana-presentation
x-pack/packages/observability/observability_utils/observability_utils_browser @elastic/observability-ui
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,7 @@
"@kbn/std": "link:packages/kbn-std",
"@kbn/streams-app-plugin": "link:x-pack/solutions/observability/plugins/streams_app",
"@kbn/streams-plugin": "link:x-pack/solutions/observability/plugins/streams",
"@kbn/streams-schema": "link:x-pack/packages/kbn-streams-schema",
"@kbn/synthetics-plugin": "link:x-pack/solutions/observability/plugins/synthetics",
"@kbn/synthetics-private-location": "link:x-pack/packages/kbn-synthetics-private-location",
"@kbn/task-manager-fixture-plugin": "link:x-pack/test/alerting_api_integration/common/plugins/task_manager_fixture",
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -1878,6 +1878,8 @@
"@kbn/streams-app-plugin/*": ["x-pack/solutions/observability/plugins/streams_app/*"],
"@kbn/streams-plugin": ["x-pack/solutions/observability/plugins/streams"],
"@kbn/streams-plugin/*": ["x-pack/solutions/observability/plugins/streams/*"],
"@kbn/streams-schema": ["x-pack/packages/kbn-streams-schema"],
"@kbn/streams-schema/*": ["x-pack/packages/kbn-streams-schema/*"],
"@kbn/synthetics-e2e": ["x-pack/solutions/observability/plugins/synthetics/e2e"],
"@kbn/synthetics-e2e/*": ["x-pack/solutions/observability/plugins/synthetics/e2e/*"],
"@kbn/synthetics-plugin": ["x-pack/solutions/observability/plugins/synthetics"],
Expand Down
3 changes: 3 additions & 0 deletions x-pack/packages/kbn-streams-schema/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @kbn/streams-schema

This shared package contains the Zod schema definition for the Streams project.
10 changes: 10 additions & 0 deletions x-pack/packages/kbn-streams-schema/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export * from './src/apis';
export * from './src/models';
export * from './src/helpers';
12 changes: 12 additions & 0 deletions x-pack/packages/kbn-streams-schema/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

module.exports = {
preset: '@kbn/test',
rootDir: '../../..',
roots: ['<rootDir>/x-pack/packages/kbn-streams-schema'],
};
8 changes: 8 additions & 0 deletions x-pack/packages/kbn-streams-schema/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "shared-common",
"id": "@kbn/streams-schema",
"owner": "@elastic/streams-program-team",
"group": "observability",
"visibility": "shared"
}

7 changes: 7 additions & 0 deletions x-pack/packages/kbn-streams-schema/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "@kbn/streams-schema",
"description": "Streams Zod schema definition and common models shared between public and server.",
"private": true,
"version": "1.0.0",
"license": "Elastic License 2.0"
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions x-pack/packages/kbn-streams-schema/src/apis/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export * from './read_streams_response';
export * from './list_streams_response';
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { z } from '@kbn/zod';
import { streamDefintionSchema } from '../models';

export const listStreamsResponseSchema = z.object({
streams: z.array(streamDefintionSchema),
});

export type ListStreamsResponse = z.infer<typeof listStreamsResponseSchema>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { readStreamResponse } from '../fixtures/read_streams_response';
import { readStreamResponseSchema } from './read_streams_response';

describe('ReadStreamResponse', () => {
it('should successfully parse', () => {
expect(readStreamResponseSchema.parse(readStreamResponse)).toMatchSnapshot();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { z } from '@kbn/zod';
import { readStreamDefinitonSchema } from '../models';

export const readStreamResponseSchema = z.object({
streams: z.array(readStreamDefinitonSchema),
});

export type ReadStreamResponse = z.infer<typeof readStreamResponseSchema>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { ingestStream } from './ingest_stream';

export const ingestReadStream = {
...ingestStream,
inherited_fields: {
'@timestamp': {
type: 'date',
from: 'logs',
},
message: {
type: 'match_only_text',
from: 'logs',
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { ingestStreamConfig } from './ingest_stream_config';

export const ingestStream = {
name: 'logs.nginx',
elasticsearch_assets: [],
stream: ingestStreamConfig,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export const ingestStreamConfig = {
ingest: {
processing: [
{
config: {
grok: {
field: 'message',
patterns: ['%{TIMESTAMP_ISO8601:event.timestamp} %{GREEDY:rest}'],
},
},
condition: {
field: 'log.level',
operator: 'eq',
value: 'error',
},
},
],
routing: [
{
name: 'logs.errors',
condition: {
field: 'log.level',
operator: 'eq',
value: 'error',
},
},
],
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { ingestReadStream } from './ingest_read_stream';
import { wiredReadStream } from './wired_read_stream';

export const readStreamResponse = {
streams: [wiredReadStream, ingestReadStream],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { wiredStream } from './wired_stream';

export const wiredReadStream = {
...wiredStream,
inherited_fields: {
'@timestamp': {
type: 'date',
from: 'logs',
},
message: {
type: 'match_only_text',
from: 'logs',
},
},
};
14 changes: 14 additions & 0 deletions x-pack/packages/kbn-streams-schema/src/fixtures/wired_stream.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { wiredStreamConfig } from './wired_stream_config';

export const wiredStream = {
name: 'logs.nginx',
elasticsearch_assets: [],
stream: wiredStreamConfig,
};
Loading