Repository navigation
63 lines (63 loc) · 2.77 KB
/
Copy pathfullsend-langfuse.yaml
File metadata and controls
63 lines (63 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Generated by uie-fullsend langfuse-setup. Uses trusted default-branch code.
name: Fullsend Langfuse
on:
workflow_run:
workflows: [fullsend]
types: [completed]
workflow_dispatch:
inputs:
trace_id:
description: OTLP trace ID for verification (32 hexadecimal characters)
required: true
type: string
permissions:
actions: read
contents: read
concurrency:
group: langfuse-${{ github.event.workflow_run.id || github.run_id }}-${{ github.event.workflow_run.run_attempt || github.run_attempt }}
cancel-in-progress: false
jobs:
generation:
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.repository.default_branch }}
persist-credentials: false
- name: Download Fullsend output as data
if: github.event_name == 'workflow_run'
id: artifacts
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
RUN_ID: ${{ github.event.workflow_run.id }}
run: |
artifact_names="$(gh api --paginate "repos/$GH_REPO/actions/runs/$RUN_ID/artifacts?per_page=100" --jq '.artifacts[].name | select(startswith("fullsend-"))')"
if [ -z "$artifact_names" ]; then
echo "No Fullsend artifacts were published by run $RUN_ID; skipping trace export."
echo "found=false" >> "$GITHUB_OUTPUT"
exit 0
fi
if ! gh run download "$RUN_ID" --pattern 'fullsend-*' --dir "$RUNNER_TEMP/langfuse-artifacts"; then
echo "::error::Failed to download Fullsend artifacts from run $RUN_ID."
exit 1
fi
echo "found=true" >> "$GITHUB_OUTPUT"
- name: Export Langfuse trace
if: github.event_name == 'workflow_dispatch' || steps.artifacts.outputs.found == 'true'
env:
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: ${{ vars.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT }}
OTEL_EXPORTER_OTLP_TRACES_HEADERS: ${{ secrets.OTEL_EXPORTER_OTLP_TRACES_HEADERS }}
OTEL_RESOURCE_ATTRIBUTES: ${{ vars.OTEL_RESOURCE_ATTRIBUTES }}
SOURCE_RUN_ID: ${{ github.event.workflow_run.id || github.run_id }}
SOURCE_RUN_ATTEMPT: ${{ github.event.workflow_run.run_attempt || github.run_attempt }}
SOURCE_ACTOR: ${{ github.event.workflow_run.actor.login || github.actor }}
VERIFY_TRACE_ID: ${{ inputs.trace_id }}
EVENT_NAME: ${{ github.event_name }}
run: |
if [ "$EVENT_NAME" = workflow_dispatch ]; then
python3 .fullsend/scripts/langfuse-post-run.py --verify-trace-id "$VERIFY_TRACE_ID"
else
python3 .fullsend/scripts/langfuse-post-run.py "$RUNNER_TEMP/langfuse-artifacts"
fi