This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Net.Http.Json; | |
using System.Text.Json; | |
using System.Text.Json.Serialization; | |
Console.WriteLine("Start sending metrics..."); | |
var key = Environment.GetEnvironmentVariable("Api-Key"); | |
var client = new HttpClient(); | |
client.DefaultRequestHeaders.Add("Api-Key", key); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
autoReload="true" | |
throwConfigExceptions="true"> | |
<extensions> | |
<add assembly="NLog.Web.AspNetCore"/> | |
<add assembly="NewRelic.LogEnrichers.NLog" /> | |
</extensions> | |
<targets> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.Hosting; | |
using Microsoft.Extensions.Logging; | |
using NewRelic.LogEnrichers.Serilog; | |
using Serilog; | |
using Serilog.Events; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.Hosting; | |
using Microsoft.Extensions.Logging; | |
using NewRelic.LogEnrichers.Serilog; | |
using Serilog; | |
using Serilog.Events; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
redis: | |
image: "redis:alpine" | |
ports: | |
- "6379:6379" | |
expose: | |
- 6379 | |
restart: | |
always |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/newrelic/go-agent/v3/newrelic" | |
"math/rand" | |
"net/http" | |
"os" | |
"time" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -eu | |
# 必ず最新バージョンの値を指定する必要あり。最新バージョン以外は https://download.newrelic.com/php_agent/archive/ 以下からダウンロード | |
curl -L "https://download.newrelic.com/php_agent/release/newrelic-php5-9.7.0.258-linux.tar.gz" -o /tmp/newrelic-php5-9.7.0.258-linux.tar.gz | |
tar -xvzf /tmp/newrelic-php5-9.7.0.258-linux.tar.gz -C /tmp | |
NR_INSTALL_USE_CP_NOT_LN=1 NR_INSTALL_SILENT=1 /tmp/newrelic-php5-*/newrelic-install install | |
rm -rf /tmp/newrelic-php5-* /tmp/nrinstall* | |
# newrelic.ini ファイルを編集。ライセンスキーとアプリ名以外は必要に応じて追加・削除してください | |
sed -i \ | |
-e 's/"REPLACE_WITH_REAL_KEY"/"YourLicenseKey"/' \ | |
-e 's/newrelic.appname = "PHP Application"/newrelic.appname = "My PHP Lab on Azure"/' \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var assert = require('assert'); | |
var request = require('request'); | |
var util = require('util'); | |
const requestPromise = util.promisify(request); | |
var urlsToMonitor = ['https://blog.newrelic.co.jp/', 'https://docs.newrelic.co.jp/']; | |
var insightKey = $secure.INSIGHTKEY; | |
var accountId = $secure.ACCOUNTID; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ASP.NET Web(.NET Framework)のDockerfileサンプル。slnファイルと同じ階層に配置。 | |
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build | |
WORKDIR /app | |
COPY *.sln . | |
# プロジェクトファイルを格納しているフォルダごとをコピー | |
COPY HelloWCOW/ ./HelloWCOW/ | |
# ソリューションファイルを指定してMSBuildによりローカルファイルシステムに発行(Publish)する | |
RUN msbuild HelloWCOW.sln /p:Configuration=Release /p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:DeleteExistingFiles=True /p:publishUrl=\output |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Net.Http; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.AspNetCore.Mvc.RazorPages; | |
using Newtonsoft.Json; | |
using Serilog; | |
namespace WebPortal.Pages | |
{ |
NewerOlder