Skip to content
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

Automatic Epsagon / Status configuration #148

Closed
tripodsan opened this issue Mar 8, 2021 · 5 comments
Closed

Automatic Epsagon / Status configuration #148

tripodsan opened this issue Mar 8, 2021 · 5 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@tripodsan
Copy link
Contributor

tripodsan commented Mar 8, 2021

with the original, pure openwhisk deployments, each action defines usually the epsagon and status wrappers.
the benefit is that they can be additionally be configured. furthermore, the status was usually wrapped before epsagon, so that the status pings don't generate epsagon traces.

eg:

module.exports.main = wrap(main)
  .with(epsagon)
  .with(helixStatus)
  .with(logger.trace)
  .with(logger);

with the universal approach, we cannot have a universal epsagon integration, as it is not recommended by epsagon.
currently, the epsagon wrappers are enabled directly in the adapter, hence also record traces for status pings

if it should be avoided to record traces for status pings, either move the status wrapper also to the adapter, or try to delay the epsagon init until it is wrapped in the function again.

epsagon stubs in adapter

the adapter would create a epsagon initialization handler but delay the execution until it is needed by the action. the problem is that the different epsagon wrappers (openwhisk, lambda, ...) expect the respective signature of the runtime handler (main(params) or handler(event), etc). so the only way would probably be to restart the execution and skip the wrappers before. however, this is all a bit complicated and error prone.

move helix status to adapter and allow configuration

the helix-status wrapper could also happen in the adapter and allow the action to configure it.
eg:

module.exports.main = wrap(main)
  .with(logger.trace)
  .with(logger);

main.plugins = {
  status: {
    plugin: helixStatus,
    github: 'https://raw.githubusercontent.com/adobe/helix-static/master/src/index.js' 
  }
}

or even a more generic approach, that allows to define and configure all the wrappers in the action,
but allows the adapter to install them.

module.exports.main = main;

main.plugins = [{
  require('@adobe/helix-epsagon'),
  {
    plugin: require('@adobe/helix-status'),
    config: {
      github: 'https://raw.githubusercontent.com/adobe/helix-static/master/src/index.js' 
   },
  logger.trace,
  logger,
];
@tripodsan tripodsan added enhancement New feature or request question Further information is requested labels Mar 8, 2021
@trieloff
Copy link
Contributor

trieloff commented Mar 8, 2021

I'd go with the more generic approach you suggested.

@tripodsan tripodsan self-assigned this Mar 9, 2021
@tripodsan
Copy link
Contributor Author

I tried to implement it...the problem is when we move the plugins to the adapter level, they all need to be runtime aware and can't be universal again. epsagon is an exception that it can't be universal, since they need to wrap the original handler/action.

alternatively, we could try to pass down the original invocation arguments in the context and then simulate the respective signature again for epsagon....

@trieloff
Copy link
Contributor

What if we have two extension points that plugins could hook into? Pre-wrapped (epsagon) and post-wrapped (status)

@tripodsan
Copy link
Contributor Author

if we still want to avoid tracing status pings, then this doesn't help.

also, it is awkward from the perspective of an action, that is can provide a pre-wrapped plugin.
then, i'd rather just have the configuration during deploy: --no-espagon

@tripodsan
Copy link
Contributor Author

won't fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants