diff --git a/druid-otlp-format/Dockerfile b/druid-otlp-format/Dockerfile index e7163e8..14d6a22 100644 --- a/druid-otlp-format/Dockerfile +++ b/druid-otlp-format/Dockerfile @@ -1,3 +1,17 @@ +# Copyright 2024 Mishmash IO UK Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + FROM maven AS builder WORKDIR /tmp/maven-deps diff --git a/server-parquet/Dockerfile b/server-parquet/Dockerfile index 7c01688..459f725 100644 --- a/server-parquet/Dockerfile +++ b/server-parquet/Dockerfile @@ -1,3 +1,17 @@ +# Copyright 2024 Mishmash IO UK Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + FROM eclipse-temurin:17-jre-alpine ADD ./target/dependency /opt/server-parquet COPY target/server-parquet-*.jar /opt/server-parquet diff --git a/superset-visualizations/Dockerfile b/superset-visualizations/Dockerfile new file mode 100644 index 0000000..61355ce --- /dev/null +++ b/superset-visualizations/Dockerfile @@ -0,0 +1,19 @@ +# Copyright 2024 Mishmash IO UK Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM apache/superset:4.0.2 + +RUN pip install pydruid +COPY --chown=superset:superset --chmod=755 opentelemetry-demo.sh /app/ +ADD --chown=superset:superset --chmod=755 resources /app/opentelemetry-import-resources diff --git a/superset-visualizations/README.md b/superset-visualizations/README.md new file mode 100644 index 0000000..83af68a --- /dev/null +++ b/superset-visualizations/README.md @@ -0,0 +1,3 @@ +# Visualizing OpenTelemetry data with Apache Superset + +Coming soon! diff --git a/superset-visualizations/opentelemetry-demo.sh b/superset-visualizations/opentelemetry-demo.sh new file mode 100644 index 0000000..e5bbc73 --- /dev/null +++ b/superset-visualizations/opentelemetry-demo.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# Copyright 2024 Mishmash IO UK Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +export FLASK_APP=superset + +# Just init everything as a completely new Superset installation: +superset db upgrade && \ +superset fab create-admin \ + --username admin \ + --firstname OpenTelemetry \ + --lastname Demo \ + --email os@mishmash.io \ + --password admin && \ +superset init && \ +superset import-directory /app/opentelemetry-import-resources && \ +exec superset run -p 8088 --with-threads -h 0.0.0.0 diff --git a/superset-visualizations/resources/databases/Apache_Druid_for_OpenTelemetry.yaml b/superset-visualizations/resources/databases/Apache_Druid_for_OpenTelemetry.yaml new file mode 100644 index 0000000..0291185 --- /dev/null +++ b/superset-visualizations/resources/databases/Apache_Druid_for_OpenTelemetry.yaml @@ -0,0 +1,27 @@ +# Copyright 2024 Mishmash IO UK Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +database_name: Apache Druid for OpenTelemetry +sqlalchemy_uri: druid://opentelemetry-demo-druid-broker:8888/druid/v2/sql +cache_timeout: null +expose_in_sqllab: true +allow_run_async: false +allow_ctas: false +allow_cvas: false +allow_dml: false +allow_csv_upload: false +extra: + allows_virtual_table_explore: true +uuid: 3a8d1686-9390-44c1-9108-81c35aa1280f +version: 1.0.0 diff --git a/superset-visualizations/resources/datasets/Apache_Druid_for_OpenTelemetry/BASIC_SPANS.yaml b/superset-visualizations/resources/datasets/Apache_Druid_for_OpenTelemetry/BASIC_SPANS.yaml new file mode 100644 index 0000000..6f29a44 --- /dev/null +++ b/superset-visualizations/resources/datasets/Apache_Druid_for_OpenTelemetry/BASIC_SPANS.yaml @@ -0,0 +1,404 @@ +# Copyright 2024 Mishmash IO UK Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +table_name: BASIC_SPANS +main_dttm_col: __time +description: null +default_endpoint: null +offset: 0 +cache_timeout: null +schema: druid +sql: "SELECT\n __time\n , millis_to_timestamp(end_time_unix_nano / 1000000) as end_time\n\ + \ , scope_name\n , scope_version\n , kind\n , name\n , trace_id\n , span_id\n\ + \ , parent_span_id\n \n -- telemetry and runtime attrs\n , JSON_VALUE(\"resource_attributes\"\ + , '$[''telemetry.sdk.name'']') as telemetry_name\n , JSON_VALUE(\"resource_attributes\"\ + , '$[''telemetry.sdk.language'']') as telemetry_language\n , JSON_VALUE(\"resource_attributes\"\ + , '$[''telemetry.sdk.version'']') as telemetry_version\n , JSON_VALUE(\"resource_attributes\"\ + , '$[''process.runtime.description'']') as runtime_description\n , JSON_VALUE(\"\ + resource_attributes\", '$[''process.runtime.name'']') as runtime_name\n , JSON_VALUE(\"\ + resource_attributes\", '$[''process.runtime.version'']') as runtime_version\n ,\ + \ JSON_VALUE(\"resource_attributes\", '$[''service.name'']') as service_name\n \ + \ \n -- http attributes\n , COALESCE(\n JSON_VALUE(\"attributes\", '$[''http.method'']')\n\ + \ , JSON_VALUE(\"attributes\", '$[''http.request.method'']')\n ) as http_method\n\ + \ , COALESCE(\n JSON_VALUE(\"attributes\", '$[''http.scheme'']')\n , JSON_VALUE(\"\ + attributes\", '$[''url.scheme'']')\n ) as http_scheme\n , COALESCE(\n JSON_VALUE(\"\ + attributes\", '$[''http.flavor'']')\n , JSON_VALUE(\"attributes\", '$[''network.protocol.version'']')\n\ + \ ) as http_version\n , COALESCE(\n JSON_VALUE(\"attributes\", '$[''http.status_code'']')\n\ + \ , JSON_VALUE(\"attributes\", '$[''http.response.status_code'']')\n ) as http_status_code\n\ + \ , COALESCE(\n JSON_VALUE(\"attributes\", '$[''http.url'']')\n , JSON_VALUE(\"\ + attributes\", '$[''url.full'']')\n ) as http_url\n\n \n , COALESCE(\n JSON_VALUE(\"\ + attributes\", '$[''rpc.method'']')\n , JSON_VALUE(\"attributes\", '$[''grpc.method'']')\n\ + \ ) as rpc_method\n , JSON_VALUE(\"attributes\", '$[''rpc.service'']') as rpc_service\n\ + \ , JSON_VALUE(\"attributes\", '$[''rpc.system'']') as rpc_system\n , COALESCE(\n\ + \ JSON_VALUE(\"attributes\", '$[''rpc.grpc.status_code'']')\n , JSON_VALUE(\"\ + attributes\", '$[''grpc.status_code'']')\n ) as rpc_status_code\n\n , JSON_VALUE(\"\ + status\", '$.code') as status_code\n , JSON_VALUE(\"status\", '$.message') as status_message\n\ + \ , attributes\nfrom otlp_spans\n" +params: null +template_params: null +filter_select_enabled: true +fetch_values_predicate: null +extra: null +normalize_columns: false +always_filter_main_dttm: false +uuid: 753d3562-dacf-41f5-a0ea-82f42b245ce4 +metrics: +- metric_name: count + verbose_name: COUNT(*) + metric_type: count + expression: COUNT(*) + description: null + d3format: null + currency: null + extra: null + warning_text: null +columns: +- column_name: rpc_status_code + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: telemetry_language + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: trace_id + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: status_code + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: service_name + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: scope_name + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: span_id + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: telemetry_name + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: runtime_name + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: rpc_service + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: runtime_description + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: rpc_method + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: scope_version + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: rpc_system + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: end_time + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: telemetry_version + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: runtime_version + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: attributes + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: name + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: kind + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: __time + verbose_name: null + is_dttm: true + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: parent_span_id + verbose_name: null + is_dttm: false + is_active: true + type: null + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: http_status_code + verbose_name: null + is_dttm: false + is_active: true + type: null + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: status_message + verbose_name: null + is_dttm: false + is_active: true + type: null + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: http_scheme + verbose_name: null + is_dttm: false + is_active: true + type: null + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: http_method + verbose_name: null + is_dttm: false + is_active: true + type: null + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: http_version + verbose_name: null + is_dttm: false + is_active: true + type: null + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: http_url + verbose_name: null + is_dttm: false + is_active: true + type: null + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +version: 1.0.0 +database_uuid: 3a8d1686-9390-44c1-9108-81c35aa1280f diff --git a/superset-visualizations/resources/metadata.yaml b/superset-visualizations/resources/metadata.yaml new file mode 100644 index 0000000..e8eb835 --- /dev/null +++ b/superset-visualizations/resources/metadata.yaml @@ -0,0 +1,16 @@ +# Copyright 2024 Mishmash IO UK Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +version: 1.0.0 +timestamp: '2024-10-16T08:15:32.282442+00:00'