Giter Club home page Giter Club logo

Comments (4)

bsieber-mozilla avatar bsieber-mozilla commented on August 15, 2024

Could we possibly reuse the instrumentation (we use for statsd) to add these logs?

def wrapper(*args, **kwargs):
# Increment the call counter.
statsd.incr(f"jbi.{prefix}.methods.{func.__name__}.count")
# Time its execution.
with statsd.timer(f"jbi.{prefix}.methods.{func.__name__}.timer"):
return func(*args, **kwargs)
return wrapper

from jira-bugzilla-integration.

grahamalama avatar grahamalama commented on August 15, 2024

That's a good idea, and I thought the same thing 🙌🏻. Some thoughts there:

  • We might want to log both client methods (via the decorator you linked, or maybe a new decorator) and service methods (the methods contained in this issue). Logging service methods would be good for when we bail out of a method, such as delete_jira_issue_if_duplicate:
        jira_key_in_bugzilla = latest_bug.extract_from_see_also(
            project_key=context.jira.project
        )
        _duplicate_creation_event = (
            jira_key_in_bugzilla is not None and issue_key != jira_key_in_bugzilla
        )
        if not _duplicate_creation_event:
+           logger.debug("No Jira issue to delete")
            return None
  • I wish we "owned" the Jira client, I've tried to think of a few ways to inject our request ID into logging so that we can correlate requests, and it's ended up feeling a little invasive.

from jira-bugzilla-integration.

bsieber-mozilla avatar bsieber-mozilla commented on August 15, 2024

Upon quick glance--most of the service methods call the client methods; so we'd be logging as we make the service call internally, and then as we make the client call. Some of the service methods are minimally different than the client ones, but I can imagine there being value in a more in-depth breadcrumb trail for logging.

What if we followed a similar format that we did with the client logging: create a decorator and apply it to the service methods in question--possibly format with method_name: {method_name}; parameters: {parameters}; results: {results} (not pushing for this as a solution--just a formulaic possibility)

...As I write this out--it depends on what we plan on using this information for and how it would be most useful for our team; if we wanted to be able to follow an error stack to determine where something went wrong? For audit trails (for a bug_id)?

//It might be worthwhile to have a context object that tracks the methods and results and submits it all to the logging agent when the processing finishes? //

(fin brain dribble 😵 )

from jira-bugzilla-integration.

bsieber-mozilla avatar bsieber-mozilla commented on August 15, 2024

It might be nice to have a visual as to where we're at with our current logging practices to understand where our largest "holes" are to cover.

And if our current logging is not at all where we want to be--then rethinking the entire logging strategy could be worth some time (but possibly something we do at a later time--not to take away from this card, as there is still value by increasing the transparency of what the service is doing).

from jira-bugzilla-integration.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.