Skip to content

Conversation

@akihikokuroda
Copy link
Contributor

@akihikokuroda akihikokuroda commented Jan 23, 2026

Misc PR

Type of PR

  • Bug Fix
  • New Feature
  • Documentation
  • Other

Description

Testing

  • Tests added to the respective file if code was changed
  • New code has 100% coverage if code as added
  • Ensure existing tests and github automation passes (a maintainer will kick off the github automation when the rest of the PR is populated)

@github-actions
Copy link
Contributor

The PR description has been updated. Please fill out the template for your PR to be reviewed.

@mergify
Copy link

mergify bot commented Jan 23, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|release)(?:\(.+\))?:

@nrfulton nrfulton self-requested a review January 23, 2026 22:46
Copy link
Member

@psschwei psschwei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Viewed using Jaeger:

Image

Console output:

$ uv run python docs/examples/instruct_validate_repair/101_email.py
=== 15:14:33-INFO ======
Starting Mellea session: backend=ollama, model=granite4:micro, context=SimpleContext, model_options={'@@@max_new_tokens@@@': 200}
  0%|                                                                                                                                                | 0/2 [00:00<?, ?it/s]=== 15:14:37-INFO ======
SUCCESS
  0%|                                                                                                                                                | 0/2 [00:03<?, ?it/s]
[{'role': 'user', 'content': 'Write an email to invite all interns to the office party.', 'images': None}]
Calling end() on an ended span.
***** email ****
Subject: Invitation for Our Annual Office Party

Dear All Interns,

We hope this message finds you well.

As part of our
commitment to fostering a sense of community within our organization, we would like to cordially invite all interns to
join us for our annual office party. This event is not only an opportunity for fun and networking but also a chance to
celebrate the achievements of the year and look forward to new opportunities in the coming year.

Here are the details:
**Date:** [Insert Date]
**Time:** [Insert Time]
**Venue:** [Insert Venue]

The evening will feature entertainment,
refreshments, and engaging conversations. We encourage you all to dress according to our company's formal attire policy
for this event.

We believe that your contribution is crucial to our success and we are excited about the potential
projects and ideas that lie ahead. This party is a wonderful opportunity to mingle with other interns from different
departments and share some memorable moments together.

Please RSVP by [Insert Date] so we can
*******
{
    "name": "start_session",
    "context": {
        "trace_id": "0xcb77451be2139eeee65422fb74fc2a56",
        "span_id": "0x8ed3d33ef3c5baed",
        "trace_state": "[]"
    },
    "kind": "SpanKind.INTERNAL",
    "parent_id": null,
    "start_time": "2026-01-26T20:14:33.550934Z",
    "end_time": "2026-01-26T20:14:33.671424Z",
    "status": {
        "status_code": "UNSET"
    },
    "attributes": {
        "backend": "ollama",
        "model_id": "granite4:micro",
        "context_type": "SimpleContext"
    },
    "events": [],
    "links": [],
    "resource": {
        "attributes": {
            "telemetry.sdk.language": "python",
            "telemetry.sdk.name": "opentelemetry",
            "telemetry.sdk.version": "1.38.0",
            "service.name": "my-mellea-app"
        },
        "schema_url": ""
    }
}
{
    "name": "session_context",
    "context": {
        "trace_id": "0x8adc89297851d8b1a677334ba5c2ee2c",
        "span_id": "0x38d0ffe787d3904d",
        "trace_state": "[]"
    },
    "kind": "SpanKind.INTERNAL",
    "parent_id": null,
    "start_time": "2026-01-26T20:14:33.671493Z",
    "end_time": "2026-01-26T20:14:33.671512Z",
    "status": {
        "status_code": "UNSET"
    },
    "attributes": {
        "backend": "OllamaModelBackend",
        "context_type": "SimpleContext"
    },
    "events": [],
    "links": [],
    "resource": {
        "attributes": {
            "telemetry.sdk.language": "python",
            "telemetry.sdk.name": "opentelemetry",
            "telemetry.sdk.version": "1.38.0",
            "service.name": "my-mellea-app"
        },
        "schema_url": ""
    }
}
{
    "name": "generate_from_context",
    "context": {
        "trace_id": "0x39a9159baa5e4915d07d31536f09e224",
        "span_id": "0x234a5cfb7d16861e",
        "trace_state": "[]"
    },
    "kind": "SpanKind.INTERNAL",
    "parent_id": "0x6b624448401e507b",
    "start_time": "2026-01-26T20:14:33.673531Z",
    "end_time": "2026-01-26T20:14:33.690153Z",
    "status": {
        "status_code": "UNSET"
    },
    "attributes": {
        "backend": "OllamaModelBackend",
        "model_id": "ibm-granite/granite-4.0-micro",
        "action_type": "Instruction",
        "context_size": "0",
        "has_format": "False",
        "tool_calls": "False"
    },
    "events": [],
    "links": [],
    "resource": {
        "attributes": {
            "telemetry.sdk.language": "python",
            "telemetry.sdk.name": "opentelemetry",
            "telemetry.sdk.version": "1.38.0",
            "service.name": "my-mellea-app"
        },
        "schema_url": ""
    }
}
{
    "name": "aact",
    "context": {
        "trace_id": "0x39a9159baa5e4915d07d31536f09e224",
        "span_id": "0x6b624448401e507b",
        "trace_state": "[]"
    },
    "kind": "SpanKind.INTERNAL",
    "parent_id": null,
    "start_time": "2026-01-26T20:14:33.671686Z",
    "end_time": "2026-01-26T20:14:37.671402Z",
    "status": {
        "status_code": "UNSET"
    },
    "attributes": {
        "action_type": "Instruction",
        "has_requirements": "False",
        "has_strategy": "True",
        "strategy_type": "RejectionSamplingStrategy",
        "has_format": "False",
        "tool_calls": "False",
        "num_generate_logs": "1",
        "sampling_success": "True",
        "response": "Subject: Invitation for Our Annual Office Party\n\nDear All Interns,\n\nWe hope this message finds you well.\n\nAs part of our commitment to fostering a sense of community within our organization, we would like to cordially invite all interns to join us for our annual office party. This event is not only an opportunity for fun and networking but also a chance to celebrate the achievements of the year and look forward to new opportunities in the coming year.\n\nHere are the details:\n\n**Date:** [Insert Da...",
        "response_length": "1042"
    },
    "events": [],
    "links": [],
    "resource": {
        "attributes": {
            "telemetry.sdk.language": "python",
            "telemetry.sdk.name": "opentelemetry",
            "telemetry.sdk.version": "1.38.0",
            "service.name": "my-mellea-app"
        },
        "schema_url": ""
    }
}

```bash
export MELLEA_TRACE_APPLICATION=true
export MELLEA_TRACE_BACKEND=false
python your_script.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: would it make sense to use one of the existing examples for the docs, so that folks could easily copy and paste the code snippets to try them out? (maybe docs/examples/instruct_validate_repair/101_email.py)

@akihikokuroda
Copy link
Contributor Author

Additional Jaeger screen shot.
Screenshot 2026-01-26 at 5 46 55 PM

Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add telemetry

2 participants