npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@harnessio/backstage-plugin-harness-chaos

v0.2.0

Published

Website: [https://harness.io/](https://harness.io/)

Downloads

680

Readme

Harness Chaos Engineering Plugin

Website: https://harness.io/

Welcome to the Harness Chaos Engineering plugin for Backstage!

Screenshots

Setup steps

  1. Open terminal and navigate to the root of your Backstage app. Then run
yarn add --cwd packages/app @harnessio/backstage-plugin-chaos

yarn install

If you are looking to get started with Backstage, check out backstage.io/docs.

For testing purposes, you can also clone this repository to try out the plugin. It contains an example Backstage app setup which is pre-installed with Harness plugins. However, you must create a new Backstage app if you are looking to get started with Backstage.

  1. Configure proxy for harness in your app-config.yaml under the proxy config. Add your Harness Personal Access Token or Service Account Token for x-api-key. See the Harness docs for generating an API Key.
# In app-config.yaml

proxy:
  # ... existing proxy settings
  '/harness':
    target: 'https://app.harness.io/'
    headers:
      'x-api-key': '<YOUR PAT/SAT>'
# ...

Notes:

  • Plugin uses token configured here to make Harness API calls. Make sure this token has the necessary permissions

  • Set the value of target to your on-prem URL if you are using the Harness on-prem offering

  1. Inside your Backstage's EntityPage.tsx, update the chaosContent component to render <EntityHarnessChaosContent /> whenever the service/project is using Harness Chaos Engineering. Something like this -
// In packages/app/src/components/catalog/EntityPage.tsx

import {
  EntityHarnessChaosContent,
  isHarnessChaosAvailable,
} from '@harnessio/backstage-plugin-harness-chaos';

...

const chaosContent = (
  <EntitySwitch>
    <EntitySwitch.Case if={isHarnessChaosAvailable}>
      <EntityHarnessChaosContent />
    </EntitySwitch.Case>

    <EntitySwitch.Case>
      <EmptyState
        title="No Chaos data available for this entity"
        missing="info"
        description="You need to add an annotation to your component if you want to enable Chaos for it. You can read more about annotations in Backstage by clicking the button below."
        action={
          <Button
            variant="contained"
            color="primary"
            href="https://backstage.io/docs/features/software-catalog/well-known-annotations"
          >
            Read more
          </Button>
        }
      />
    </EntitySwitch.Case>
  </EntitySwitch>
);

...

const serviceEntityPage = (
  <EntityLayout>
    <EntityLayout.Route path="/chaos" title="Chaos Engineering">
      {chaosContent}
    </EntityLayout.Route>
  </EntityLayout>
);

...
  1. Add required harness specific annotations to your software component's respective catalog-info.yaml file. (optional)

By default, all the chaos experiments will be fetched from the provided project url, providing optional annotations will fetch experiments for a specific application map.

Based upon the annotations that the user provides, we decide which version of experiments table to show.

Chaos V1:
  • scoped to all infrastructure (lists all experiments)
  • only requires project-url annotations
Chaos V2:
  • based on services/application-maps tags (lists experiments scoped to a service tag or a application map tag)
  • requires project-url annotations AND either service-tag(s) or network-tag(s)

For ease of use of the user, we check if project url is provided and then see if the service tag or network tag is provided. If only the project url is provided we default to V1 table that shows experiments for all infrastructures else if we see the other annotations also, we show service specific or application map specific experiments.

NOTE: service tag based filtering will be available at a later date.

Refer image below to locate an application map tag.

Here is an example: catalog-info.yaml

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  # ...
  annotations:
    # mandatory annotation
    harness.io/project-url: <harness_project_url>

    # optional annotations
    harness.io/application-map-tags: |
      <nm-name_1>: <nm-label_1>
      <nm-name_2>: <nm-label_2>

spec:
  type: service
  # ...

Other configurations

  • (Optional) Harness URL

If you have a separate Harness hosted URL other than https://app.harness.io, you can configure baseUrl for harness in app-config.yaml This step is optional. The default value of harness.baseUrl is https://app.harness.io/

# In app-config.yaml

harness:
  baseUrl: https://app.harness.io/

Features

  • Connect a Backstage service with a Harness project and view all the chaos experiments associated with that project.
  • Add network-map tags to view targeted chaos experiments for a specific service/application map.
  • Support for various infrastructure filters on the go.
  • See details for last 10 runs such as resilience score, status and cron schedules.
  • Directly run a chaos experiment from the dashboard itself.
  • One click redirect to run details and infrastructure management screens.