Skip to content

feat: enable skywalking plugin for tracing #86

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

Merged
merged 13 commits into from
Sep 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ jobs:
- name: Install Docker for macOS
uses: docker-practice/actions-setup-docker@master
if: ${{ matrix.platform == 'macos-latest' }}
- name: Install Docker for ubuntu
uses: docker-practice/actions-setup-docker@master
if: ${{ matrix.platform == 'ubuntu-latest' }}
- name: Install skywalking and wait for it start
run: |
docker version
docker pull apache/skywalking-oap-server:8.4.0-es6
docker run -d --name oap -p 12800:12800 -p 11800:11800 apache/skywalking-oap-server:8.4.0-es6
docker ps
sleep 20s
- name: Initialize Dapr
run: dapr init -s --runtime-version ${{ matrix.dapr-version }}
- name: Install dependencies
Expand Down
235 changes: 235 additions & 0 deletions docs/generated/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -2039,6 +2039,34 @@
"endIndex": 12
}
},
{
"kind": "PropertySignature",
"canonicalReference": "@openfunction/functions-framework!OpenFunctionContext#tracing:member",
"docComment": "/**\n * Optional trace config\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "tracing?: "
},
{
"kind": "Reference",
"text": "TraceConfig",
"canonicalReference": "@openfunction/functions-framework!TraceConfig:interface"
},
{
"kind": "Content",
"text": ";"
}
],
"isReadonly": false,
"isOptional": true,
"releaseTag": "Public",
"name": "tracing",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
},
{
"kind": "PropertySignature",
"canonicalReference": "@openfunction/functions-framework!OpenFunctionContext#version:member",
Expand Down Expand Up @@ -3168,6 +3196,213 @@
"name": "Knative"
}
]
},
{
"kind": "Interface",
"canonicalReference": "@openfunction/functions-framework!TraceConfig:interface",
"docComment": "/**\n * The config of the trace.\n *\n * @public\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export interface TraceConfig "
}
],
"releaseTag": "Public",
"name": "TraceConfig",
"preserveMemberOrder": false,
"members": [
{
"kind": "PropertySignature",
"canonicalReference": "@openfunction/functions-framework!TraceConfig#baggage:member",
"docComment": "/**\n * Trace baggage\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "baggage?: "
},
{
"kind": "Reference",
"text": "Record",
"canonicalReference": "!Record:type"
},
{
"kind": "Content",
"text": "<string, string>"
},
{
"kind": "Content",
"text": ";"
}
],
"isReadonly": false,
"isOptional": true,
"releaseTag": "Public",
"name": "baggage",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 3
}
},
{
"kind": "PropertySignature",
"canonicalReference": "@openfunction/functions-framework!TraceConfig#enabled:member",
"docComment": "/**\n * This is trace switch\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "enabled: "
},
{
"kind": "Content",
"text": "boolean"
},
{
"kind": "Content",
"text": ";"
}
],
"isReadonly": false,
"isOptional": false,
"releaseTag": "Public",
"name": "enabled",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
},
{
"kind": "PropertySignature",
"canonicalReference": "@openfunction/functions-framework!TraceConfig#provider:member",
"docComment": "/**\n * Trace Provider\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "provider?: "
},
{
"kind": "Reference",
"text": "TraceProvider",
"canonicalReference": "@openfunction/functions-framework!TraceProvider:interface"
},
{
"kind": "Content",
"text": ";"
}
],
"isReadonly": false,
"isOptional": true,
"releaseTag": "Public",
"name": "provider",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
},
{
"kind": "PropertySignature",
"canonicalReference": "@openfunction/functions-framework!TraceConfig#tags:member",
"docComment": "/**\n * Trace tags\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "tags?: "
},
{
"kind": "Reference",
"text": "Record",
"canonicalReference": "!Record:type"
},
{
"kind": "Content",
"text": "<string, string>"
},
{
"kind": "Content",
"text": ";"
}
],
"isReadonly": false,
"isOptional": true,
"releaseTag": "Public",
"name": "tags",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 3
}
}
],
"extendsTokenRanges": []
},
{
"kind": "Interface",
"canonicalReference": "@openfunction/functions-framework!TraceProvider:interface",
"docComment": "/**\n * The trace provider info.\n *\n * @public\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export interface TraceProvider "
}
],
"releaseTag": "Public",
"name": "TraceProvider",
"preserveMemberOrder": false,
"members": [
{
"kind": "PropertySignature",
"canonicalReference": "@openfunction/functions-framework!TraceProvider#name:member",
"docComment": "/**\n * Provider name Now is just support skywalking\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "name: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": ";"
}
],
"isReadonly": false,
"isOptional": false,
"releaseTag": "Public",
"name": "name",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
},
{
"kind": "PropertySignature",
"canonicalReference": "@openfunction/functions-framework!TraceProvider#oapServer:member",
"docComment": "/**\n * OapServer address example [skywalking-oap:11800]\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "oapServer: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": ";"
}
],
"isReadonly": false,
"isOptional": false,
"releaseTag": "Public",
"name": "oapServer",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"extendsTokenRanges": []
}
]
}
Expand Down
15 changes: 15 additions & 0 deletions docs/generated/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export interface OpenFunctionContext {
postPlugins?: string[];
prePlugins?: string[];
runtime: `${RuntimeType}` | `${Capitalize<RuntimeType>}` | `${Uppercase<RuntimeType>}`;
tracing?: TraceConfig;
version: string;
}

Expand Down Expand Up @@ -188,6 +189,20 @@ export enum RuntimeType {
Knative = "knative"
}

// @public
export interface TraceConfig {
baggage?: Record<string, string>;
enabled: boolean;
provider?: TraceProvider;
tags?: Record<string, string>;
}

// @public
export interface TraceProvider {
name: string;
oapServer: string;
}

// (No @packageDocumentation comment for this package)

```
1 change: 1 addition & 0 deletions output-file.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"some":"payload"}
Loading